C#: Tolerate missing solution files in tests

This commit is contained in:
Michael B. Gale
2023-11-21 13:24:36 +00:00
parent 098812b073
commit adde95d7a1

View File

@@ -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)