Skip to content
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

Application window is now small with very small text #5472

Closed
rkamarowski opened this issue Oct 8, 2021 · 8 comments
Closed

Application window is now small with very small text #5472

rkamarowski opened this issue Oct 8, 2021 · 8 comments

Comments

@rkamarowski
Copy link

This problem was originally reported to VS2019, and was determined to be a .NET CORE issue.

Opened my application in VS2019 after about 1 week away, and suddenly the Window is small with very small text. The strange thing is that the MenuItems text is normal.

System Info
SystemInfo.txt

MainWindow XAML
MainWindow.xaml.txt

Screen Capture
RunningApplicationScreenShot

zip file with small app that shows problem
Test.zip

@ryalanms
Copy link
Member

ryalanms commented Oct 8, 2021

Thank you for the report and repro application, @rkamarowski. A fix for .NET Core 3.1 was approved for the 3.1.21 servicing release. #5377.

This is the issue opened for 3.1.19: #5375

There are two temporary workarounds mentioned in 5375 by @ThomasGoulet73 and @ChristophHornung.

@rkamarowski
Copy link
Author

rkamarowski commented Oct 8, 2021 via email

@ryalanms
Copy link
Member

ryalanms commented Oct 8, 2021

Start "Add or Remove Programs". The .NET SDKs installed with Visual Studio should include "from Visual Studio".

image

The "dotnet --info" command will also show all installed SDKs and runtimes.

The WindowsDesktop runtimes will be under "c:\program files\dotnet\shared\Microsoft.NETCore.App".

C:>dotnet --info
.NET SDK (reflecting any global.json):
Version: 6.0.100-rtm.21478.18
Commit: 8fa92bad72

Runtime Environment:
OS Name: Windows
OS Version: 10.0.22159
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\6.0.100-rtm.21478.18\

Host (useful for support):
Version: 7.0.0-alpha.1.21480.1
Commit: 9556913857

.NET SDKs installed:
3.1.119 [C:\Program Files\dotnet\sdk]
3.1.119 [C:\Program Files\dotnet\sdk]
5.0.401 [C:\Program Files\dotnet\sdk]
5.0.401 [C:\Program Files\dotnet\sdk]
5.0.402 [C:\Program Files\dotnet\sdk]
5.0.402 [C:\Program Files\dotnet\sdk]
6.0.100-rc.1.21458.32 [C:\Program Files\dotnet\sdk]
6.0.100-rc.1.21458.32 [C:\Program Files\dotnet\sdk]
6.0.100-rtm.21478.18 [C:\Program Files\dotnet\sdk]
6.0.100-rtm.21478.18 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 3.1.20 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.20 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.0-rc.1.21452.15 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.0-rc.1.21452.15 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.0-rtm.21477.30 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.0-rtm.21477.30 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.0-alpha.1.21470.28 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.0-alpha.1.21470.28 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 3.1.20 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.20 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.11 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.11 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.0-rc.1.21451.13 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.0-rc.1.21451.13 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.0-rtm.21477.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.0-rtm.21477.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.0-alpha.1.21480.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.0-alpha.1.21480.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.1.20 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 3.1.20 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 5.0.11 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 5.0.11 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.0-rc.1.21451.3 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.0-rc.1.21451.3 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.0-rtm.21477.3 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.0-rtm.21477.3 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 7.0.0-alpha.1.21474.1 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 7.0.0-alpha.1.21474.1 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

To install additional .NET runtimes or SDKs:
https://aka.ms/dotnet-download

@rkamarowski
Copy link
Author

rkamarowski commented Oct 8, 2021 via email

@ryalanms
Copy link
Member

ryalanms commented Oct 8, 2021

@rkamarowski: The problem should only repro if the application targets .NET Core 3.1 and the machine has 3.1.19 or 3.1.20 runtime installed. The fix will be in 3.1.21. The runtime for the shared installation of 3.1 should be here: "c:\program files\dotnet\shared\Microsoft.NETCore.App".

There are two application workarounds discussed in the original issue, but you could also retarget the application to 5.0 or 6.0 or reinstall 3.1.18 on the machine.

@ChristophHornung
Copy link

[...] The fix will be in 3.1.20.

@ryalanms Just for clarification: you mean 3.1.21, right?

@rkamarowski
Copy link
Author

The following worked:

protected override void OnStartup(StartupEventArgs e)
	{
		SetProcessDPIAware();
		base.OnStartup(e);
	}

	[DllImport("user32.dll", SetLastError = true)]
	private static extern bool SetProcessDPIAware();

Thank you.

@ryalanms
Copy link
Member

@ChristophHornung: Thank you for catching that mistake. Yes, the fix is in 3.1.21, not 3.1.20.

@dotnet dotnet locked as resolved and limited conversation to collaborators Apr 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants