22

When I try to open a WinForms designer in my startup project in a solution, I get a screen "Loading designer...", "You can continue working while the designer is loading in the background". This screen stays forever and the designer is not loading. This seems to happen in any form or control in the project.

If I try to open the designer for another form in another project in the same solution, I get this screen but after a few seconds, the designer is opened.

I tried to clean the project, delete the ".VS" directory, reboot the machine, nothing helped...

Any ideas?

user1510694
  • 221
  • 1
  • 2
  • 4
  • 2
    Favor the legacy "Windows Forms App (.NET Framework)" project template on a machine that has this problem. The designer for .NETCore runs out-of-process, making it vulnerable to misbehaving security software. – Hans Passant Dec 03 '21 at 13:54
  • Doesn't work for me, either. I guess the machine is too old/slow. Tried different things, nothing works. Switching the logging to verbose shows it hangs on `Creating VSCodeDomDesignerLoader`. Waited 10 minutes or more, multiple times, nothing. It's possible waiting longer would make it work as the task manager shows the SQL Server activity @HansPassant: it's not necessarily anything related to security then. – Wiktor Zychla Jan 08 '22 at 20:31
  • I get this issue but it is intermittent. – Kirsten Mar 06 '22 at 05:49

13 Answers13

9

I had the same problem.

Solved by running VS 2022 as Administrator.

and wait for Nuget Package Update

3

I had the same issue.

  1. Copy all the files in the project directory.
  2. Create a new project using the template "Windows Forms App (.NET Framework)" not "Windows Forms App".
  3. Then copy all the files from the old project.
Ahmed Gad
  • 691
  • 1
  • 7
  • 26
2

I have encountered this so many times over the years with Winforms, and now happened to be hitting it again. My guess is that it's purely a resource problem for Visual Studio, combined with lack of error handling when the designer fails to get all memory that it's claiming.

Why: I've tried and failed several times over the past week with a smaller-medium sized solution, but with a complex forms setup (many controls/many nested levels of tabs etc).

I just got it loading again after battling for a couple of days with failures. As I suspected memory/resources this morning I:

  • shut down everything
  • closed all browsers with tons of tabs
  • restarted VS and closed any other bigger apps and restarted VS (VS2022 Community Edition).
  • Left the computer and did some lengthy coffe brewing

.. and surprise when I got back - it loaded for the first time in 5 days.

Next time I'd hit this, what would be really interesting would be switching to another computer - if an opportunity.

@Microsoft staff in case you see this, try stress testing with low resources and see how the Forms Designer behaves.

Edit: I do not run VS as Admin.

Mosca Pt
  • 517
  • 4
  • 10
1

I had same problem. I tried Restore Nuget Packages and problem solved.

  1. Select Tools -> Options -> NuGet Package Manager then check Allow Nuget to download missing packages.
  2. Right click on the solution and select Restore Nuget Packages.
  3. Close the solution and reopen it.
Dharman
  • 30,962
  • 25
  • 85
  • 135
ManoWar
  • 11
  • 1
  • 3
0

first, you must check NuGet Packet Manager Tools -> NuGet Package Manager -> Package Manager Setting

popup form, click NuGet Package Manager -> General in this tab check "Allow NuGet to download missing packages".

move to down tab "Package Source" if you just have one source is "Microsoft Visual Studio Offline Packages" you just add a package from API NuGet

click oke and taraaaaaa did it work

0

I was able to fix it by unchecking the option "Track Active Item in Solution Explorer".

Follow these steps to disable this option:

  1. Click the menu Tools > Options
  2. Expand "Projects and Solutions" and click "General"
  3. Uncheck the option "Track Active Item in Solution Explorer"
  4. Click OK
  5. Observe you can now open the Form editor by clicking to Form1.cs by example
Less White
  • 561
  • 4
  • 13
0

Migrated from Studio 2019 on W7 to Studio 2022 on W10. Before opening a 2019 project, I manually change: TargetFramework>net5.0-windows in: TargetFramework>net6.0-windows

Then I rename the net5.0-windows map in the bin\debug in net6.0-windows.

Then I open the project and build it.

After this the forms open.

I tried to use the MS upgrade utility, but that one changed the Forms in Class with the impossibility to open them in the Designer

Martin
  • 1,430
  • 10
  • 19
0

I had the same issue.

The only solution I found:

  • Remove project dependencies
  • Clear the solution

and the designer start working :)

0

I'm currently getting this if my project doesn't have a <Platforms> tag.

If I change the tag to <Platform> (even though I have a single platform x86), it hangs the designer. If I switch back to <Platforms>, it works. (With a project reload in between.) If I have no tag (I am inheriting the property from a props file), it doesn't work.

It pretty consistently works as long as there is a <Platforms> tag. I also need such a tag in a referenced project that has a base form class. (Without one in the base library, the designer would start to load but would get stuck with a grey background.)

Dave Cousineau
  • 12,154
  • 8
  • 64
  • 80
  • This inspired me to try just unloading / reloading the project, and that worked for me. I didn't have a Platform / Platforms tag - this was a branch new project in a branch new solution. Unloading / Reloading the project must do something magical. – Michael Bray Jul 18 '23 at 10:57
0

In case the designer is waiting for Intellisense (the designer might state "Waiting for intelliSense to finish initializing"), uncheck the ‘Load projects faster’ option in Tools>>Options>>Environment>>Preview Features.

enter image description here

In my case, the Designer loaded immediately after unchecking. Eventually, you need to restart Visual Studio.

This was an answer in https://developercommunity.visualstudio.com/t/winforms-designer-not-loading-message-says-waiting/1161031 in 2020, but it still worked with my Visual Studio 2022.

shful
  • 394
  • 1
  • 5
  • 8
0

For me it helped updating project from .NET 5.0 to .NET 6.0. You first have to check if all dependencies can be used for .NET 6.0

Tore
  • 1
0

I'm running VS2022 and I don't think I've ever loaded/viewed my Toolbox since installing this version (ie: Toolbox was not visible in my IDE).

I opened my solution, opened an aspx page in Source view that had a control who's designer I wanted to view (and was causing VS to hang when I tried for weeks now) I clicked Toolbox from the View menu and it had to initialize before displaying. I'm not sure if this step was necessary, but I dragged and dropped the same type of control to my page. All of a sudden I can view the designer window for any type of control on that page. Its a miracle!

PTansey
  • 567
  • 4
  • 12
-2
  1. don't back up your projects with OneDrive
  2. don't give administrator permission to framework or dotnet or visual studio and don't install that way