views:

17

answers:

1

Hi there. When editing parts of my project that get called in Application_Start(), i want to have the web app restart every time i press 'Debug', so that i can debug these parts. But if i dont change the Global.asax.cs self, it doesnt restart and therefore doesnt fire the Application_Start().

Is there any setting or trick to let the app restart each time i start a new debug?

A: 

If you are using the development server, simply right-click>stop on the tray icon. When it starts back up you will have a fresh new app-domain that needs to execute global.asax.

Or, in any case, dev or IIS, simply add a space or otherwise modify the web.config file - that will recycle the app domain.

Update - on further consideration: Have you tried re building.

Another thought - you could add a 'pre-build event' that 'touches' the web.config using a command line. BUT - you will probably want to define a special build configuration with configuration manager that is clearly marked, otherwise you may forget that you are killing your app domain and chase your tail in circles. ;p

try searching for 'windows touch file timestamp'.

Sky Sanders
But thats manually, like adding and deleting space to global.asax and save. I would like to have it automated.
Marks
@marks - there is not really a clear path to do this, as having appdomains cycle is generally not a desired thing, more like an indication that something is FUBAR - so no, I don't know of a way you can do this that would 1) take less effort than options stated, and 2) not result in a closed loop of start/reset/start/reset - just stopping the dev server is the clearest path.
Sky Sanders
@marks - update with a possible solution.
Sky Sanders