diff --git a/src/Snap/Extensions/SnapExtensions.cs b/src/Snap/Extensions/SnapExtensions.cs index 81322d91..2e842d1d 100644 --- a/src/Snap/Extensions/SnapExtensions.cs +++ b/src/Snap/Extensions/SnapExtensions.cs @@ -511,6 +511,11 @@ internal static SnapApp BuildSnapApp([NotNull] this SnapApps snapApps, string id throw new Exception("Supervisor id cannot be an empty guid."); } + if (snapApp.MainExe != null && string.IsNullOrWhiteSpace(snapApp.MainExe)) + { + throw new Exception("MainExe property cannot be null or whitespace."); + } + var snapAppUniqueRuntimeIdentifiers = snapApp.Targets.Select(x => x.Rid).ToList(); if (snapAppUniqueRuntimeIdentifiers.Distinct().Count() != snapApp.Targets.Count) { @@ -759,7 +764,7 @@ internal static void GetCoreRunExecutableFullPath([NotNull] this SnapApp snapApp if (snapFilesystem == null) throw new ArgumentNullException(nameof(snapFilesystem)); if (baseDirectory == null) throw new ArgumentNullException(nameof(baseDirectory)); - var exeName = snapApp.Id; + var exeName = snapApp.MainExe ?? snapApp.Id; if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) { exeName += ".exe";