32

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?

4
  • I have the same problem, it's maddening. If I do "Start without debugging", there's a 30-90 second wait from after compile until the page loads. Then pages run fine. Anytime I re-compile the project in VS, I go through this wait time. I tried CassiniDev & TCPView - tcpview shows the connection being made, but CassiniDev doesn't log the request until after the wait. So CassiniDev accepts the socket, but doesn't process it for a minute. What's going on here?? Aug 12, 2011 at 16:07
  • @Rocketmonkeys: Yeah, I'm still having the same problem, too, on all the computers I develop on. So far, I haven't found a solution, but I completely forgot that I asked this question, so maybe someone will help here. Aug 14, 2011 at 4:28
  • I recently started having this problem with regular ASP.net projects.
    – Soenhay
    Mar 25, 2013 at 21:59
  • I haven't found the solution to this problem since VS 2005 and i've try all @maxim-zaslavsky test is his UPDATE #2 Nov 9, 2014 at 21:41

7 Answers 7

8

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.

5
  • Thanks for yet another great answer, Jon! I'll try this out in a few minutes. Nov 24, 2010 at 6:59
  • Creating a brand new MVC project and debugging into that takes much less time, so I guess the issue is with my code. I use OutputCaching heavily throughout my app, not just for the pages themselves, but for the javascript and CSS components, too. Could "building" the cache slow debugging down a lot? Nov 24, 2010 at 22:06
  • @Maxim: I doubt it - I'd expect the cache to be populated lazily, although I confess I don't know anything about MVC. Can you hook up a profiler? That will tell you where your time is going.
    – Jon Skeet
    Nov 24, 2010 at 22:19
  • even if you don't know anything about MVC, your advice is very good! Never mind about the cache thing - I just ran another test on the brand new MVC project and this time it took as long as my big project takes (2 - 3 minutes). I'm convinced it's something to do with the environment. Nov 25, 2010 at 0:35
  • @Maxim: Wow - that's extremely weird. Was the MVC project the only one in the solution? Do you have any colleagues in the same situation?
    – Jon Skeet
    Nov 25, 2010 at 6:24
4

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

1
  • 2
    There are two other questions on Stack Overflow with that solution, but as I said in my question, that didn't fix the problem. Thanks anyway! Nov 25, 2010 at 0:59
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

1
  • I've disabled IntelliTrace but haven't noticed any change yet. Will try some more - thanks! Dec 4, 2010 at 2:25
3

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

1

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.

0

I was having the same problem. It ended up being a problem with ColdFusion being installed on my local machine (as painful as it is for me to admit). ColdFusion puts Handler Mappings named AboMapperCustom-* that were causing the latency. I uninstalled ColdFusion because I no longer need it (thank God). Another solution could be to remove each AboMapperCustom entry through the web.config. Example:

<handlers>
    <remove name="AboMapperCustom-15397" />
    <remove name="AboMapperCustom-20358" />
    <remove name="AboMapperCustom-47286" />
</handlers>

Make sure the 5-digits following AboMapperCustom- match those in your local IIS Handler Mappings.

HTH

0

On Visual Studio 2012 + Win10 x64, i've noticed that if you

  • go to the taskbar and find the asp.net dev server there,
  • right click it and do a "show details"
  • close the box (NOT 'stop', just close via 'x')

then the server loads almost instantly

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.