-
Notifications
You must be signed in to change notification settings - Fork 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
PublishAot
deployment ignores call to Application.SetHighDpiMode
#11543
Comments
So you followed the warning and commented out Do you have a copy of your program.cs? |
@elachlan actually the other way around. App was looking strange in aot mode, so I tried to enable dpi awareness via manifest, it worked, but produced warning. |
@Olina-Zhang can your team please verify? |
We can repro it in the latest .NET 9.0 Preview6 SDK build with |
Is it related to this? #9911 (comment) |
@chrarnoldus |
If you don't do this via the project settings, but have the code manually added in Program.cs to control HighDPI settings and other settings, does that then change anything? Also not, that Trimming/AOTing WinForms Apps is not supported at this time, but we're working on it. |
@KlausLoeffelmann adding this doesn't resolve the issue. static Program()
{
Application.SetHighDpiMode(HighDpiMode.SystemAware);
}
[System.Runtime.CompilerServices.ModuleInitializer]
internal static void M1()
{
Application.SetHighDpiMode(HighDpiMode.SystemAware);
} Huh, "supported" winforms trimming looks like this |
.NET version
.NET SDK:
Version: 9.0.100-preview.5.24307.3
Commit: 35b2c21ea6
Workload version: 9.0.100-manifests.6407b7e4
MSBuild version: 17.11.0-preview-24279-02+b963c24ef
Runtime Environment:
OS Name: Windows
OS Version: 10.0.19045
OS Platform: Windows
RID: win-x64
Microsoft.WindowsDesktop.App 9.0.0-preview.5.24306.8
Did it work in any of the earlier releases of .NET Core or .NET 5+?
No response
Issue description
dotnet publish
dotnet run
or publish with<dpiAware />
in manifestbut specifying dpi awareness in manifest results in warning
CSC : warning WFAC010: Remove high DPI settings from C:\Source\ttt\app.manifest and configure via Application.SetHighDpiMode API or 'ApplicationHighDpiMode' project property
Display settings
Steps to reproduce
mkdir ttt && cd ttt && dotnet new winforms
Form1.cs
ttt.csproj
app.manifest
The text was updated successfully, but these errors were encountered: