user19302
user19302

Reputation:

Asp.net do you leave the debugging server open while developing?

I'm new to ASP.net but not to C#, .net or Web Development.

In PHP it was nice to be able to go right to the browser and refresh whenever I made a change. Using ASP.net with VS08 however seems a bit awkward.

Should I launch a development server and keep it open, refreshing the browser when I make a change or should I close the development server between editing code?

Sorry if this sounds silly but I'm just not sure what the "accepted" practice is here.

Upvotes: 1

Views: 171

Answers (5)

Mark Brittingham
Mark Brittingham

Reputation: 28865

I use IIS even for development so there is no "launch" of the web server at all. That being said, I will typically alt-tab between code I'm working on and the browser window while I am fine-tuning HTML, Ajax calls, or the code behind. Bigger changes require a restart and you will receive a message that the code is no longer in synch with the web site (during an exception) when you must restart.

The bottom line: you can debug while running in an ASP.NET application and, as long as you can get away with it, it is an effective way of tuning your software.

Upvotes: 0

Helen Toomik
Helen Toomik

Reputation: 2115

I launch my dev server and then leave it running all the time. Instead of closing down the dev server, I detach the debugger, and when I need to step through code I attach it again. This gives me the best of both worlds: saves me the web server startup time AND runs pages fast most of the time.

Upvotes: 1

Ken Browning
Ken Browning

Reputation: 29101

You have two options when going from Visual Studio to the browser. The first is to debug the application by pressing F5 and running it. The second is to choose the "View In Browser" command (or use the keyboard shortcut Ctrl+Shift+W). The latter doesn't attach debuggers to the web server which makes it much faster than debugging but doesn't support things like code-behind break points or breaking into code upon unhandled asp.net excpetions.

For fastest development, minimize the number of times that your web server is started and how many times you attach the debugger to the web server.

Upvotes: 2

Yaakov Ellis
Yaakov Ellis

Reputation: 41510

Depends what stage of development I am in.

If I am adding lots of files (something that you can't do in Debug mode), changing lots of code in App_Code (which will reset the app) or adding lots of components from the toolbox, then I will tend to leave Debug off.

Once I start actively debugging a site, then I will leave it on as much as possible.

Upvotes: 0

Ray Booysen
Ray Booysen

Reputation: 30031

When developing with Cassini, I always just let it run as it saves the startup time whenever I want to debug. It doesn't hurt to do so, it'll always reflect the current built DLLs and works pretty well.

Upvotes: 2

Related Questions