Warnings as errors

This commit is contained in:
Matthew Parker [SSW]
2023-09-20 21:52:13 +10:00
parent d2ca5cff05
commit 1345c56eea
6 changed files with 256 additions and 19 deletions

View File

@@ -21,7 +21,6 @@ public static class SolutionProjectParity
{
var csprojList = RetrieveAllCSharpProjectFullPathsFromFolder(solutionFolderPath);
csprojList = csprojList.Select(x => x.Replace(solutionFolderPath, "")).ToArray();
return csprojList;
}
@@ -57,7 +56,7 @@ public static class SolutionProjectParity
foreach (var project in csprojList)
{
var projectInSolution = projects.FirstOrDefault(x => x.RelativePath == project);
var projectInSolution = projects.FirstOrDefault(x => NormalizePath(x.AbsolutePath) == NormalizePath(project));
if (projectInSolution == null)
{
@@ -79,4 +78,10 @@ public static class SolutionProjectParity
return projectList;
}
private static string NormalizePath(string path)
{
return Path.GetFullPath(new Uri(path).LocalPath)
.TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar);
}
}