Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is the ASP.NET/Visual Studio Web Development Server so slow?

Compiling - XKCD(xkcd)

I know that compiling nowadays is much faster than it was before. Yet, for me, it seems that compiling and especially running/debugging ASP.NET projects with the Visual Studio Web Development Server is incredibly slow.

Since the beginning of last summer, I've been working heavily on ASP.NET MVC projects. Of course, the best way to debug them is by using the web server that comes with Visual Studio. When doing that, I get horrendously slow loading times. Chrome dev tools typically report that loading one of my pages had a 3 minute wait time, followed by a short loading time.

I've seen these two questions, but they don't help. While I do most of my debugging work in Chrome, the same happens in IE.

Has anyone else had this problem before? If so, any tips?

Also, I doubt that the problem lies with the speed of my machine. This computer is really fast running Windows 7 and Visual Studio 2010, so I don't see why ASP.NET debugging should be so slow.


UPDATE: In his answer below, Jon Skeet suggested attempting to identify whether the problem is being caused by the environment or by the code itself. I created a brand new MVC project and ran it. The first test appeared to be much faster. However, after testing it a few more times, it's safe to say that the first test was an anomaly - usually, it takes as long as my big project (2 - 3 minutes). Thus, this is a problem with the environment. Thanks in advance for any help!


UPDATE #2: It's been a while since I updated this question. Here are some details I've gathered since my last update:

  • This delay is occuring on both of my development machines, both running Windows 7 and Visual Studio 2010
  • This delay is happening for all my MVC2 and MVC3 projects (but I haven't experimented with plain ASP.NET yet)
  • Plain/vanilla MVC projects experience the same delay as MVC projects with big codebases
  • Disabling IntelliTrace did not help
  • Disabling IPv6 did not help

I haven't found a solution for this problem, so I've been stuck with huge wait times. Does anyone know how to solve this?

like image 709
Maxim Zaslavsky Avatar asked Nov 24 '10 06:11

Maxim Zaslavsky


1 Answers

There's no reason why it should take 3 minutes to start debugging something unless you've got something really strange going on.

I suggest you launch the debugger, try to navigate to a page and then just break into the debugger while it's loading. See where you're losing time. Maybe you're making some call on startup which is failing, but taking minutes to do so.

I've never experienced anything like what you're describing, which suggests it's either in your environment or in your code - and if it's a generally fast computer, that suggests it's somewhere in the code.

If you create a brand new MVC project and debug into that, does that take a long time?

You might also want to run Wireshark when you start debugging - see whether something in your app is trying to fetch a network resource of some description without you realising it.

like image 195
Jon Skeet Avatar answered Sep 22 '22 16:09

Jon Skeet