From eaa9d8ebefb59cb289e147223b242d77e69f0861 Mon Sep 17 00:00:00 2001 From: Elinor Fung Date: Wed, 20 Sep 2023 15:55:32 -0700 Subject: [PATCH] Skip getting Windows GUI bit on non-Windows in AppHostShellShimMaker --- src/Cli/dotnet/ShellShim/AppHostShimMaker.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sdk/src/Cli/dotnet/ShellShim/AppHostShimMaker.cs b/src/sdk/src/Cli/dotnet/ShellShim/AppHostShimMaker.cs index eb9a1332299..7240150e06d 100644 --- a/src/sdk/src/Cli/dotnet/ShellShim/AppHostShimMaker.cs +++ b/src/sdk/src/Cli/dotnet/ShellShim/AppHostShimMaker.cs @@ -40,14 +40,14 @@ public void CreateApphostShellShim(FilePath entryPoint, FilePath shimPath) string entryPointFullPath = Path.GetFullPath(entryPoint.Value); var appBinaryFilePath = Path.GetRelativePath(Path.GetDirectoryName(appHostDestinationFilePath), entryPointFullPath); - if (ResourceUpdater.IsSupportedOS()) { - var windowsGraphicalUserInterfaceBit = PEUtils.GetWindowsGraphicalUserInterfaceBit(entryPointFullPath); + bool windowsGraphicalUserInterface = OperatingSystem.IsWindows() + && PEUtils.GetWindowsGraphicalUserInterfaceBit(entryPointFullPath) == WindowsGUISubsystem; HostWriter.CreateAppHost(appHostSourceFilePath: appHostSourcePath, appHostDestinationFilePath: appHostDestinationFilePath, appBinaryFilePath: appBinaryFilePath, - windowsGraphicalUserInterface: (windowsGraphicalUserInterfaceBit == WindowsGUISubsystem) && OperatingSystem.IsWindows(), + windowsGraphicalUserInterface: windowsGraphicalUserInterface, assemblyToCopyResourcesFrom: entryPointFullPath, enableMacOSCodeSign: OperatingSystem.IsMacOS()); }