How can I save time when testing/debugging ASP.net locally?
I have alway tested/debugged my web applic开发者_JAVA技巧ations by using f5 to "Start Debugging". Recently (yesterday) I have begun to start without debugging then attach the debugger to the webdev process if I needed to set breakpoints or anything. So far I haven't noticed much of a performance increase when not using the debugger. I am curious about how others save time when running locally. Is it a good idea to only attach the debugger when I need it? Any other options are welcome as well! Thanks!
I don't think you are going to see much of a performance increase. But if you do find yourself frequently attaching to a process manually, you can set up a macro to attach the debugger to whatever process you want to attach to, and then assign the macro to a button or hotkey. I used to do this when debugging old classic asp code, to set up the debugger to attach to IIS.
You can use record macro to create the macro, and then manually edit it if you need to make it more flexible.
Here is a macro I found online you could try as well: http://weblogs.asp.net/koenv/archive/2008/02/14/quick-attach-and-detach-debugger.aspx
I used to debug like you (i.e. Host the Website in IIS an then attach the debugger) But i've found using Cassini far more productive because of the edit and continue feature, which is an absolute godsend.
iirc webdev == cassini
one other way is to run actual IIS - it's always on, even if you shut down VS, so it may be faster to come up. I am not sure it's actually faster when re-compiling, should be the same or faster. VS2010 supports IIS mode pretty well, plus you get the advantage of being able to test web.config properly, since cassini doesn't support system.webserver portion. We are switching to IIS mode due to url rewriter module, for example.
精彩评论