Improve dotnet host runtime detection if pack has multiple different versions

This commit is contained in:
Wojtek Figat
2023-03-22 14:20:38 +01:00
parent 4c1519ba1b
commit 4c4a559125
2 changed files with 31 additions and 7 deletions

View File

@@ -35,6 +35,8 @@ public class nethost : ThirdPartyModule
throw new Exception($"Missing NET SDK {DotNetSdk.MinimumVersion}.");
if (!dotnetSdk.GetHostRuntime(options.Platform.Target, options.Architecture, out var hostRuntimePath))
{
if (options.Target.IsPreBuilt)
return; // Ignore missing Host Runtime when engine is already prebuilt
if (options.Flags.HasFlag(BuildFlags.GenerateProject))
return; // Ignore missing Host Runtime at projects evaluation stage (not important)
throw new Exception($"Missing NET SDK runtime for {options.Platform.Target} {options.Architecture}.");