views:

105

answers:

2

In some projects, but not all, when I open a designer for the first time (either WinForms or typed dataset) Visual Studio thrashes the disk for up to 30 minutes while freezing (this appears to be reads and writes with between 100 and 140 pages\sec). Once it has done it the first time for a project, it's fine opening other projects until I close and re-open VS where it will freeze/thrash again the first time I open a designer.

Does anyone else see this, what the hell is it doing, and is there anything I can do to stop it?

A: 

It sounds like you are either running short on RAM and opening a designer puts it over the top or your hard disk needs to be defragmented.

It could be registry fragmentation too. Try pagedefrag.

Jeff Leonard
As I mentioned above, my disk is in good condition (I defrag fairly regularly).My machine has 3Gb, and the system appears to report 1.5Gb free (although I think I'll find another utility to verify this).So it doesn't appear to be either of these two things.Herbie
Dr Herbie
Ok, I can verify that throughout the entire process a minimum of 1Gb of free memory is available. Free memory drops by about 40Mb while the disk is being thrashed, but rises again at the end.So it's not that I'm short of memory or that my HDD is defragmented.
Dr Herbie
A: 

OK, so it looks like it was defunct database connections in the Server Explorer tab:

A database on our test server was removed without my knowledge, but my project still had a data connection set up for it. It seems that whenever a table adapter is initialised in the designer, VS tries to connect to all the databases in the data connections list causing issues if the database does not exist. It even tries to connect to data connections that are not used by the current table adapter.

Some of our WinForms were badly written (naughy devs!) and were loading data in the constructors without checking for 'DesignMode' - these have been repaired.

Herbie

Dr Herbie