Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I debug asp.net applications more quickly in Visual Studio 2010

I am getting pretty frustrated by debugging, but maybe I am just doing it wrong.

When I am actively developing it is extremely cumbersome to write some code, fire up the debugger to test said code, wait a minute for the debugger to start, look at the page in the browser, stop the debugger, edit the code, rinse, lather, repeat.

I can get around that by using CTRL-F5 and CTRL-SHIFT-B during development but I lose all the benefits of the debugger.

Is there a better way to use the debugger, or something else I can do to get quick rebuilds and use of the debugger?

Thanks,

Kyle

P.S. I/we do write unit tests, but you also need to test your app in the browser so please no "you shouldn't have this problem if your unit tests were written properly." comments ;)

Update

Thanks for the "get a better machine" suggestions. Not much I can do there. Loads of RAM and an Intel SSD. I shouldn't need more than a $2500 machine to code a web app.

like image 827
Kyle West Avatar asked Dec 06 '10 16:12

Kyle West


3 Answers

Debug fewer times: If you are stopping the debugger to change values or test different scenarios then don't. While debugging you can change the values of the variables using QuickWatch or the Immediate Window.

Make debugging less costly: Turning off batch will make your page load faster on the first time since it will no longer precompile all of your pages and user controls. This is good for development if you are making changes quite often.

<compilation ... batch="false"> ...</compilation>
like image 148
hyprsleepy Avatar answered Nov 18 '22 21:11

hyprsleepy


You should take a look at this post (tweeted by Scott Guthrie):

Slash your ASP.NET compile/load time without any hard work http://blog.lavablast.com/post/2010/12/01/Slash-your-ASPNET-compileload-time.aspx

Summary

  1. Get better hardware (Big impact)
  2. Store your temporary IIS files on your fastest disk or a RAM disk e.g. <compilation ... tempDirectory="q:\temp\iistemp\"> ... </compilation>
  3. Restructure your projects
    • Selectively build the necessary projects
  4. Review a few magical settings (Most impact)
    • <compilation ... batch="false"> ...</compilation>
    • <compilation ... optimizeCompilations="true"> ... </compilation>
like image 5
Fabian Avatar answered Nov 18 '22 19:11

Fabian


Get an SSD and boat-loads of RAM.

like image 3
Marcelo Cantos Avatar answered Nov 18 '22 19:11

Marcelo Cantos