dotnet / winforms

Windows Forms is a .NET UI framework for building Windows desktop applications.
MIT License
4.42k stars 984 forks source link

Form designer is not loaded successfully when switching application's target framework from 7.0 to 8.0 in project's properties window #7939

Closed Olina-Zhang closed 2 years ago

Olina-Zhang commented 2 years ago

.NET version

8.0.100-alpha.1.22512.32

Did it work in .NET Framework?

Yes

Did it work in any of the earlier releases of .NET Core or .NET 5+?

Yes, cannot repro when switching application's target framework from .Net 6.0 to .Net 7.0

Issue description

Form designer cannot be loaded successfully when switching application's target framework from 7.0 to 8.0 in project's properties window image

More Info

  1. This issue cannot repro when creating Winforms .Net 8.0 application directly
  2. This issue cannot repro when changing target framework in application's csproj file from net7.0-windows to net8.0-windows directly

Steps to reproduce

Repro steps:

  1. Create a Winforms .Net 7.0 application
  2. In Solution Explorer, right click application node, and choose Properties
  3. Expand Target framework, choose .Net 8.0
  4. Build this application

There has an error in csproj file about missing -windows, then add it image

  1. Build this application again without any error
  2. Open form designer again

Result: Form designer is loaded very long time, and failed finally with an error

dreddy-work commented 2 years ago

related https://github.com/microsoft/winforms-designer/issues/4714

merriemcgaw commented 2 years ago

Closing as External. We'll track internally to make sure that once .NET 8 SDK is inserted into VS everything works as expected.