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

10,739

Solution 1

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.

Solution 2

This is due to the IPv6 DNS problem within Firefox and can be fixed by setting the network.dns.disableIPv6 setting to true within the about:config

Slow DNS response - Firefox on localhost and Visual Studio or Cassini

Solution 3

This is actually a known performance issue with MVC, caused by throwing a ton of exceptions internally on startup. If you have IntelliTrace turned on, this will wreck havoc with it. Try disabling IntelliTrace and see if that improves it at all.

Source: http://connect.microsoft.com/VisualStudio/feedback/details/535799/debugging-mvc-is-very-very-slow

Solution 4

Check out if this helps:

http://blogs.msdn.com/b/mahuja/archive/2008/07/08/resolving-very-slow-symbol-loading-with-vs-2008-during-debugging.aspx

Solution 5

I met the same problem these days, working under Win7, VS2010, and developing a Silverlight solution with 10+ projects. It takes about 3 minutes to launch IE, and waits 3 minutes to get back VS after closing IE. I overcame the problem by trying different ways. But the only valuable method:

  1. Unload all projects not for debug
  2. Start debug the solution (it works normal )
  3. Reload other projects
  4. VS works normal here. (VS works normal)

It seems the problem is just related with the VS environment on my side. It has nothing to do with ASP.NET Development Server or IIS.

Share:
10,739
Maxim Zaslavsky
Author by

Maxim Zaslavsky

I'm a computer science student at Princeton University, originally from San Diego, CA. I use machine learning to approach problems in biology and healthcare. My current research applies machine learning to immunology. I wrote my first app (a VB6-powered word-search solver) when I was 7, and I've been hooked on programming ever since. I discovered and got involved in the Stack Overflow community in 2009 (when I was 12). Check out my website for more information or to get in touch.

Updated on June 14, 2022

Comments

  • Maxim Zaslavsky
    Maxim Zaslavsky almost 2 years

    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?