-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OutputType does not set Nt headers correctly on Linux #3990
Comments
My workaround is here for those interested: |
@swaroop-sridhar @nguerrera it is possible/make sense to have a cross platform impl to set Windows headers? |
@wli3 If the target generated is a PE Image, the GUI/CUI bit should be set correctly, regardless of the host OS. I think the HostModel can handle this when generating PE files, if the information passed in from the SDK. https://github.com/dotnet/runtime/blob/4f9ae42d861fcb4be2fcd5d3d55d5f227d30e723/src/installer/managed/Microsoft.NET.HostModel/AppHost/HostWriter.cs#L60-L69 |
@swaroop-sridhar so we can remove the check for host machine OS? |
@wli3 The resource updater makes actual Win32 calls, so it only supports Windows hosts for now. But we should be able to set the GUI/CUI bit correctly regardless of whether we can update the resources. |
I expected that this bit should be set properly -- because the SDK's computation of the So, we need to investigate what went wrong here. |
Probably fixed by dotnet/runtime#89303 in 8.0, untested though. |
Fixed in 8.0 |
Publishing my app on
mcr.microsoft.com/dotnet/core/sdk:3.0.101-buster
for win-x64, it seems that theOutputType
is completely ignored from the resulting executable. (not usingPublishSingleFile
)The NT Headers value for subsystem is console instead of Windows GUI.
Workaround: Binary modification of the executable.
The text was updated successfully, but these errors were encountered: