Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get Application_End to run while debugging (or when stopping debugging)?

I want to handle application shutdown gracefully when stopping debugging or stopping the IIS Express web site, but I cannot seem to get Application_End to run.

like image 871
Triynko Avatar asked Nov 23 '15 23:11

Triynko


People also ask

How to go to next line while debugging in Visual Studio?

You can click the Debug | Step Over menu or press the keyboard shortcut F10 to execute the current line and jump into the next line for execution.

How to debug c# line by line?

If you're not sure how to step line, by line, put a breakpoint where you want to start debugging line by line (or pause the app) then use F10 as "Step Over" or F11 as "Step Into" instead of F5 ("Go").


2 Answers

If you're debugging using IIS Express, the Application_End function will execute if you right-click on the IIS Express icon on the tray, select the proper site from the context menu and stop it. This will end your debugging session in a way that does execute the Application_End method.

like image 177
k3davis Avatar answered Oct 01 '22 21:10

k3davis


Try to make a change in web.config and save.

like image 34
Kaveh Hadjari Avatar answered Oct 01 '22 21:10

Kaveh Hadjari