diff --git a/csharp/autobuilder/Semmle.Autobuild.Shared/Solution.cs b/csharp/autobuilder/Semmle.Autobuild.Shared/Solution.cs index d48cfa15913..caddda4bb26 100644 --- a/csharp/autobuilder/Semmle.Autobuild.Shared/Solution.cs +++ b/csharp/autobuilder/Semmle.Autobuild.Shared/Solution.cs @@ -61,6 +61,12 @@ namespace Semmle.Autobuild.Shared { try { + // SolutionFile.Parse won't throw a FileNotFoundException if it is given a Windows path on a non-Windows platform + if (!builder.Actions.FileExists(FullPath)) + { + throw new FileNotFoundException(FullPath); + } + solution = SolutionFile.Parse(FullPath); } catch (Exception ex) when (ex is InvalidProjectFileException || ex is FileNotFoundException)