Add -dotnet=ver command arg to Flax.Build to specify .NET SDK version to use for build

This commit is contained in:
Wojtek Figat
2023-11-25 12:16:13 +01:00
parent 2cef368282
commit 40d6e18e7e
8 changed files with 91 additions and 20 deletions

View File

@@ -164,7 +164,7 @@ namespace Flax.Build
#if USE_NETCORE
var dotnetSdk = DotNetSdk.Instance;
if (!dotnetSdk.IsValid)
throw new Exception("Cannot compile C# without .NET SDK");
throw new DotNetSdk.MissingException();
string dotnetPath = "dotnet", referenceAnalyzers;
string[] runtimeVersionNameParts = dotnetSdk.RuntimeVersionName.Split('.');
string runtimeVersionShort = runtimeVersionNameParts[0] + '.' + runtimeVersionNameParts[1];