There's something odd going on inside the ASP.NET designer of visual studio 2005. When you first open the designer it normally starts in markup mode, all is fine. But as soon as I move over to the Graphical designer surface it starts eating up a lot of memory and it takes 5 minutes just to build the object tree in memory and display it.
I tried reproducing it by closing and restarting VS2005, open my solution again and edit a different file. The second file I tried was a pretty simple one, it was based on a masterpage and no custom base control. There were only four controls on it, so it should be pretty easy for the designer. As I expected, the designer opened pretty fast. But when I tried the same thing with a similar page, VS2005 was slow again and even hung on the operation of switching between markup and design mode.Again, after restarting visual studio all was fine again.
It seems that something goes haywire when you open a second file, because I tried the troubling operation again with two complex aspx files and the behaviour was exactly the same. The only solution I found so far is to skip the design mode and do all the page layout in markup, this makes it a bit harder to build a page, but in the end it's more rewarding as it's all a bit cleaner then it would otherwise be if I used the designer.
Personally I think it's time to give Microsoft a headsup on this problem and hope it works better in Visual Studio Orcas.
— UPDATE —
Rolf mailed me today that the problem I'm experiencing here has to do with way the designer surface was build. It's slow because it has to recompile the page after every change and this can be quite a time consuming process I noticed. He also told me that this problem is fixed in Visual Studio Orcas. So I grabbed Orcas and opened the site in it and indeed it works faster there.
But why the designer only gets slow after having opened a second page is a complete mystery.
5 comments
Willem,
Does this behaviour also occurs with the same project on another development box?
bartg
It works a bit better on my notebook, although it’s slow over there too. But that might be because I only have 512MB there.
willemm
Willem,
To me, it sounds like a installation-specific problem you are experiencing. Maybe if you put up a ‘step-by-step’ reproduction scheme I might be able to try it at my workstation at work.
bartg
The reproduction scheme I used looks like this:
– Create a new ASP.NET Web Application Project
– Create a masterpage
– Create a page based on the masterpage
– Add a gridview to the page and configure it to an object datasource (I used a test database and a dataset to get the data)
Now to get the “desired” result I switched from source view to design view.
This should cause VS2005 to get slow, it’s recognizable by texts like “Create GridView1 control” in the statusbar.
I tried it on Visual Studio Orcas too and it works there, so that’s a good thing. However I did get another error there that’s definitly a bug, I already notified microsoft of that problem.
willemm
I have noticed this behavior when using ‘drag ‘n’ drop’ to add a data control to a page that has a ‘live’ designer connection to the database to infer the schema.
It might be that this is slowing things down…
ernow