summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2024-04-08 11:19:50 +0200
committerRémi Verschelde <rverschelde@gmail.com>2024-04-08 11:19:50 +0200
commit2fb6f7f31aabf50dc4d24ef12786f1811f0ef44b (patch)
treee177515ebe6624f07028929e1d03b9892ca321df
parentc50dc9b6dd8acc92f7ef1f36799cd9143e2ca4a2 (diff)
parent316f253558c447a5789334a28fa1817dc71d5aa4 (diff)
downloadredot-engine-2fb6f7f31aabf50dc4d24ef12786f1811f0ef44b.tar.gz
Merge pull request #87829 from nongvantinh/fix-86591
Throw exception when solution file is missing during exporting
-rw-r--r--modules/mono/editor/GodotTools/GodotTools/Export/ExportPlugin.cs7
1 files changed, 7 insertions, 0 deletions
diff --git a/modules/mono/editor/GodotTools/GodotTools/Export/ExportPlugin.cs b/modules/mono/editor/GodotTools/GodotTools/Export/ExportPlugin.cs
index 46020fda89..57611d5f4c 100644
--- a/modules/mono/editor/GodotTools/GodotTools/Export/ExportPlugin.cs
+++ b/modules/mono/editor/GodotTools/GodotTools/Export/ExportPlugin.cs
@@ -90,6 +90,13 @@ namespace GodotTools.Export
$"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");