question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Net Core 3.1 issues

See original GitHub issue

Hi! I tried to build your library with my Net Core 3.1 app (since they introduce WinForms for it) and have some differences with control positioning/size compared to build for net framework.

  1. Controls mostly look shifted down by ~5 pixels
  2. Input box height looks thinner by ~5 pixels
  3. Custom control placed by code shows in wrong place,
  4. Form’s upper blue strip renders with white holes, when controls are placed on it 5 Tab selector is longer, when it should be and so on Possibly, it is same position/size issue - i cannot find out why it happen.

I understand, that there is no need to port for unconsistent technology (lack of constructor), but since MS claims Core 3.1 winforms itself production-ready, maybe you kindly agree to investigate it a little?

Note that WinForms Constructor for Core still does not work properly, even in last VS 2019 16.6.0 Preview 6.0 (it wolud be fully completed near december, they say), but you can trick it to use old Constructor, changing target platform in project file like this: <TargetFrameworks>net48;netcoreapp3.1</TargetFrameworks> instead of <TargetFramework>netcoreapp3.1</TargetFramework> then rebuild for net48 and reload - old constructor will work. To build for core, just change target expanding project execution button in VS

My whole project file for Core (they changed format): <Project Sdk="Microsoft.NET.Sdk.WindowsDesktop"> <PropertyGroup> <OutputType>Library</OutputType> <TargetFrameworks>net48;netcoreapp3.1</TargetFrameworks> <UseWindowsForms>true</UseWindowsForms> <GenerateAssemblyInfo>false</GenerateAssemblyInfo> </PropertyGroup> </Project> Thank you!

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
garciaaacommented, May 13, 2020

It is definitely “DPI-aware” issue. Since net 4.7 there is so called per-display DPI awareness. People have issues with it not only in WinForms, but also in WPF. If dpi-awareness disabled - app looks blurred when display set to 150 dpi for example. Net itself have whole tjing to handle high-dpi displaying, but it needs additional effort (more for winforms). In my case i decided disabling all that by setting this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; instead of default this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; and my app looks exactly as it was in net framework. Consider adding “dpi awareness” to your great lib. It will not be too complicated, you need to convert units and react to Control.DpiChangedAfterParent, Control.DpiChangedBeforeParent, Form.DpiChanged events

Further reading: https://stackoverflow.com/questions/22735174/how-to-write-winforms-code-that-auto-scales-to-system-font-and-dpi-settings https://stackoverflow.com/questions/13228185/how-to-configure-an-app-to-run-correctly-on-a-machine-with-a-high-dpi-setting-e http://crsouza.com/2015/04/13/how-to-fix-blurry-windows-forms-windows-in-high-dpi-settings/ SVG (vector, scalable) graphics: https://github.com/vvvv/SVG

0reactions
leocbcommented, May 13, 2020

Good to know! Thanks

Read more comments on GitHub >

github_iconTop Results From Across the Web

NET Core 3.1 Known Issues
NET Core 3.1 Known Issues. This document lists known issues for .NET Core 3.1 Preview 1 and beyond releases which may be encountered...
Read more >
Breaking changes in .NET Core 3.1
If you're migrating to version 3.1 of .NET Core or ASP.NET Core, the breaking changes listed in this article may affect your app....
Read more >
Chapter 7. Known Issues .NET Core 3.1
The known issues for running .NET Core on Red Hat Enterprise Linux (RHEL) include the following issues. .NET Core only runs on RHEL...
Read more >
Microsoft urges devs to migrate away from .NET Core 3.1 ...
Microsoft has urged developers still using the long-term support (LTS) release of .NET Core 3.1 to migrate to the latest .NET Core versions ......
Read more >
Issues updating .NET Core - what patch am I supposed to ...
NET Core 3.1 is EOL on December 13, 2022. So any and all 3.1 versions will be flagged as vulnerable after that date....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found