-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Displayed Windows Forms Controls Differ in Single File Deployment #42593
Comments
Tagging subscribers to this area: @agocke |
Thanks for reporting! Workaround is to add a manifest to your app and add the "enable themes for common controls" section: <!-- Enable themes for Windows common controls and dialogs (Windows XP and later) -->
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="*"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency> Then it works in both cases the same. |
Related to dotnet/sdk#12904 ? |
Thanks @jkotas - definitely related, but there's something else going on here:
So the only difference I can think of is that the failing case is using singlefilehost, while all the other cases are using apphost. But I don't see a difference in the two which would cause this... |
@vitek-karas Agreed on this issue being related to Windows 10 support. If memory serves the Windows 10 styling is included when support is indicated in the manifest. Do we know the manifest situation in the apphost vs singlefilehost? |
I looked at the manifests of apphost and singlefilehost as produced by the repro - and they are identical (baring any mistakes I might have made). That's what's really weird - as far as I can tell the two binaries look the same. |
@jkotas Boo. That is unfortunate. We should also check out WPF I guess. |
WPF at least by default should be OK as it does all of its rendering, unlike WinForms which relies on the OS. But there definitely could be some other problems. This is basically "WinForms is currently not fully compatible with single-file" - unfortunately. Not sure what the fix is though - I can't find a way to create activation context without a file on disk in Win32 APIs. We would have to make this a resource of the singlefilehost - which is definitely doable. |
Yep. That is a requirement for the activation context - at least my understanding. I used an Activation Context in CoreRun. runtime/src/coreclr/src/hosts/corerun/corerun.cpp Lines 415 to 445 in a986fe1
|
Just retested this again with Visual Studio 16.9.0 Preview 3 and .NET SDK 5.0.200.preview.20614.14 and looks like things got worse:
This happens with or without the manifest mentioned above. |
With #47464 the behavior should be consistent no matter the environment - meaning it should always fail. We think this regression happened because those who tested it happen to run in an environment where it worked. |
Description
Steps to reproduce:
Expected Behavior:
No matter if published as single file or not the Windows Forms controls should be displayed the same when executed in the same Windows environment.
Configuration
The text was updated successfully, but these errors were encountered: