Skip to content

Commit

Permalink
Show errors when solution file is missing in C# project
Browse files Browse the repository at this point in the history
Fixes: godotengine#86591

Co-authored-by: Raul Santos <[email protected]>
  • Loading branch information
2 people authored and DanielSnd committed Apr 10, 2024
1 parent 89e4511 commit 0692ae5
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,13 @@ public override void _ExportFile(string path, string type, string[] features)
$"Resource of type {Internal.CSharpLanguageType} has an invalid file extension: {path}",
nameof(path));

if (!ProjectContainsDotNet())
{
_maybeLastExportError = $"This project contains C# files but no solution file was found at the following path: {GodotSharpDirs.ProjectSlnPath}\n" +
"A solution file is required for projects with C# files. Please ensure that the solution file exists in the specified location and try again.";
throw new InvalidOperationException($"{path} is a C# file but no solution file exists.");
}

// TODO: What if the source file is not part of the game's C# project?

bool includeScriptsContent = (bool)GetOption("dotnet/include_scripts_content");
Expand Down

0 comments on commit 0692ae5

Please sign in to comment.