What can cause a design look to be so slow?

With small projects, I can switch to viewing almost immediately (<1 s).

I have a large project that takes about 60 seconds to open a control or form in a design view - for the first time. After this 60-second delay, I can open any control in the project in design mode almost instantly - until I recompile the project.

If the exe created by this project is referenced in another (small) project, the small project instantly becomes as sluggish as the large project. Similarly, if I add all the files from a large project to a small project individually, the small project will become equally sluggish.

A large project refers to a large managed project in C ++, but if I add the same link (and call the function from the link to make sure it is loaded) in a small project, the small project still runs quickly.

My big project uses SandDock. If my small project uses SandDock, it is still fast.

My large project contains about 60 user controls that appear in the toolbar. If I add 60 user controls to a small project, the small project will still be fast.

If I make user controls hidden from the toolbar using [System.ComponentModel.ToolboxItem (false)], the large project is still slow.

The problem arises in both vs2005 and vs2008.

What can make a large project so slow as to open design for the first time? Some other links? A large number of controls? A large number of classes? Any other reason?

One thing I noticed (though perhaps a red herring) is that the ProjectAssemblies folder (C: \ Documents and Settings \ tim.gradwell \ Local Settings \ Application Data \ Microsoft \ VisualStudio \ 9.0 \ ProjectAssemblies) is huge (> 1 GB) and most folders here have a copy of my managed C ++ dll! It seems that these folders are recreated each time the project view is reopened (after recompilation). Could this have anything to do with moderation?


Additional Information:

A dashboard in a user control or form makes it take 60 seconds. Removing the dashboard (but still having several other controls on the form) allows the switch to instantly view the design.

This is not the whole story, though ... The toolkit in a completely new project does not cause a massive slowdown - so there should be something in my big project that affects the toolbars. In addition, some other forms / controls that do not have dashboards on them still take 60 seconds to display the design view, so anything affecting the dashboards also affects other controls. I will continue to try to pinpoint which controls and perhaps even what causes it!

+7
c # visual-studio winforms
source share
4 answers

Despite the fact that you have marked classes that do not appear in the toolbar, Visual Studio still needs to check all of your open projects to detect this. To speed things up, you need to turn off the setting in order to automatically populate the toolbar. This can be a little annoying if you work a lot with the toolbar, but it will speed up a lot.

The parameter is in Tools -> Options -> Windows Forms Designer, set the "AutoToolboxPopulate" parameter to false.

+7
source share

First answer: β€œThis parameter is located inβ€œ Tools ”->β€œ Parameters ”->β€œ Windows Forms Designer ”, setβ€œ AutoToolboxPopulate ”toβ€œ false ”for me. The designer hung for at least a minute trying to focus on form control when first looked at the form in the design. Now it only takes a few seconds. (I don't have enough reputation points to directly comment on this answer)

+2
source share

The same thing happens with my 2005, in addition to the fact that devenv.exe accidentally freezes

and even after being β€œcreated”, sometimes user controls tend to distort the basic shape

Have you recently scanned and defragmented a virus?

0
source share

I had this problem in a Win CE 6.0 project in Visual Studio 2005. The project uses System.Data.SQLite.dll v1.0.65.0. Every time I opened or recompiled a project, and then tried to open a form with a grid for design, there would be at least a 12-minute delay. It turns out that he created 770-odd folders under "My Documents \ Local Settings \ Application Data \ Microsoft \ Visual Studio \ 8.0 \ Project Assemblies", most of which had a copy of only the SQLite DLL.
The problem is that I referenced this DLL in the project from the "sibling" folder in my project. As an example:
Project folder: "... Projects \ ThisAndThat \ projectFolder"
DLL folder: "... Projects \ ThisAndThat \ projectFolderBin"
There may be other relationships with folders that exhibit this problem, but I have not investigated.
I moved the DLL to the folder "Program Files \ Microsoft.NET \ SDK \ CompactFramework \ v2.0 \ WindowsCE" and the problem disappeared. I have a form with a tab control containing two tabs. Each tab contains a datagrid control. This form now loads almost instantly in the designer.
If anyone knows of a better solution or which settings or behavior of VS2005 is causing this problem, add a comment.

0
source share

All Articles