diff --git a/src/Cli4Fody/Arguments/TargetPath.cs b/src/Cli4Fody/Arguments/TargetPath.cs index 3740ba3..f4b253c 100644 --- a/src/Cli4Fody/Arguments/TargetPath.cs +++ b/src/Cli4Fody/Arguments/TargetPath.cs @@ -10,7 +10,7 @@ private TargetPath(string value) { if (!Path.IsPathRooted(value)) { - value = Path.Combine(System.IO.Directory.GetCurrentDirectory(), value); + value = Path.Combine(System.IO.Directory.GetCurrentDirectory(), NativePath(value)); } Value = value; Directory = Path.GetDirectoryName(value)!; @@ -43,7 +43,7 @@ public string[] GetProjectPaths() var solutionContent = File.ReadAllText(Value); var matches = ProjectMatcher().Matches(solutionContent); - _projectPaths = matches.Select(x => Path.Combine(Directory, x.Groups[1].Value)).ToArray(); + _projectPaths = matches.Select(x => Path.Combine(Directory, NativePath(x.Groups[1].Value))).ToArray(); } } @@ -57,6 +57,8 @@ public static TargetPath Parse(string targetPath) return new(targetPath); } + private static string NativePath(string path) => path.Replace('\\', Path.DirectorySeparatorChar); + [GeneratedRegex(@"Project\("".*""\) = "".*"", ""([^""]+\.csproj)""")] private static partial Regex ProjectMatcher(); } diff --git a/src/Cli4Fody/Cli4Fody.csproj b/src/Cli4Fody/Cli4Fody.csproj index 8f93edf..af556e7 100644 --- a/src/Cli4Fody/Cli4Fody.csproj +++ b/src/Cli4Fody/Cli4Fody.csproj @@ -3,7 +3,7 @@ Exe net8.0 - 1.0.0 + 1.0.1 ihourglass enable enable