Search code examples
asp.netvisual-studioeditordesigner

Visual Studio - Why do .ASPX files take so much longer to load than .ASPX.CS files?


This may be a stupid question, but it's something that bugs me on a regular basis, so no harm in asking here I guess.

What exactly is Visual Studio doing when I open up an .ASPX file and it takes a good 4-5 seconds longer than if I was just opening the code behind file (.ASPX.CS).

I've noticed this happening with VS 2003, 2005 and 2008, and on a newly built machine too, so it's not an issue of my dev machine being too slow.

It seems to only happen when opening any .ASPX file for the first time in a particular session though. Is there some processing going on that I can disable to get rid of this delay?

Cheers


Solution

  • Because Visual Studio has to process the aspx files to represent them in design view. Source files do not have a design view.

    It probably caches what it needs for design view. This will make things faster the next time it wants to load the file.