You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ktsu.Sdk.App published for win-x64 from Linux/macOS ships as a console app: the WinExe switch also requires a Windows build host #89
Sdk.App/Sdk.props:11-18 switches the output type to WinExe only when the build host is Windows:
<PropertyGroupCondition="$([MSBuild]::IsOSPlatform('Windows')) And $(RuntimeIdentifier.StartsWith('win'))">
<OutputType>WinExe</OutputType>
</PropertyGroup>
<PropertyGroupCondition="$([MSBuild]::IsOSPlatform('Windows')) And '$(RuntimeIdentifier)' == ''">
<OutputType>WinExe</OutputType>
</PropertyGroup>
Whether an apphost uses the GUI or the console subsystem should depend on the target runtime, not on the machine that built it. Today, dotnet publish -r win-x64 of a ktsu.Sdk.App project on Linux or macOS leaves OutputType=Exe. The resulting .exe uses the console subsystem, so a Windows user who launches the GUI (ImGui) app also gets a console window.
The README says "OutputType=WinExe on Windows (no console window)" (README.md:219) and the host-runtime-only section (README.md:486) says it switches "when the runtime identifier starts with win". Neither mentions that the build host also has to be Windows.
Reproduction
The .NET SDK handles WinExe fine on a non-Windows host. On Linux with .NET 10, cleaning bin/obj between runs:
A project importing Sdk.App/Sdk.props, evaluated with -p:RuntimeIdentifier=win-x64, reports OutputType = Exe.
dotnet publish -r win-x64 --self-contained false produces an apphost whose PE header says subsystem 3 (console).
The same publish with -p:OutputType=WinExe produces subsystem 2 (GUI).
The shared release job runs on windows-latest, so org releases are not affected today. Local and other non-Windows publishes are affected now, and the releases would be too if that job ever moved to Linux.
Suggested fix
Key the first condition on the target RID alone: $(RuntimeIdentifier.StartsWith('win')).
Keep the host check only for the fallback with no RID, where the host is the target.
Add a property-evaluation test (for example next to PlatformSdkResolutionTests) that evaluates the App demo with RuntimeIdentifier=win-x64 and expects WinExe on any host.
Acceptance criteria
-r win-x64 produces WinExe on every host.
-r linux-x64 and -r osx-arm64 produce Exe on every host.
With no RID: WinExe on a Windows host and Exe elsewhere, as today.
Priority: Low. Publishing a ktsu.Sdk.App project for win-x64 from Linux or macOS produces a console-subsystem .exe, so the GUI app opens a console window. Org releases are not affected today because the shared release job runs on windows-latest. Only local or other non-Windows cross-publishes are, and the fix is a one-line condition change. Raise it if the release job ever moves off Windows.
Area / suggested owner:Sdk.App/Sdk.propsOutputType conditions, plus a property-evaluation test next to PlatformSdkResolutionTests. README lines 219 and 486 should also say what the behaviour is after the fix.
Activity
matt-edmondson commentedon Oct 31, 2026
Triage
win-x64from Linux or macOS produces a console-subsystem.exe, so the GUI app opens a console window. Org releases are not affected today because the shared release job runs onwindows-latest. Only local or other non-Windows cross-publishes are, and the fix is a one-line condition change. Raise it if the release job ever moves off Windows.Sdk.App/Sdk.propsOutputTypeconditions, plus a property-evaluation test next toPlatformSdkResolutionTests. README lines 219 and 486 should also say what the behaviour is after the fix.KtsuHostRuntimeOnlywork in KtsuHostRuntimeOnly resolves the wrong RID under ktsu.Sdk.Linux/macOS/Windows, and does nothing when set in a .csproj as the README shows #63, so check that the two stay consistent.Generated by Claude Code