ASP.Net - Global.asax Application_Start event does not fire

By [)ia6l0 iii

There are many threads on the internet that tell you to play with Session or any other web.config values to get Global.asax events working. If they do not work, then this tip is for you.

The IIS Process can be started well before the Visual Studio Debugger is attached to the process. So you will never hit the breakpoints that you set in the Application Start event.

An alternative that you can follow is to attach the debugger to the aspnet worker process and then hit the url.

Related FAQs

To stop a robot from visiting your website and causing undesirable robot traffic and many other problems, follow one of the below said three ways:
One of the best ways is to use the RouteConstraint to validate the route values and then choose a route to controller. Route values that hold values of integer is the best example. If the route value is passed as string which cannot be converted to an Integer, we suffer with run-time and unhandled exceptions on our code.
Use Page.ClientQueryString to get the encoded query string portion of the requested url.
Use Page.MaintainScrollPositionOnPostBack to retain the scroll position after a postback. You can set it as a page directive:
Use the FileContentResult as the ActionResult to send byte array as http response.
Use the FilePathResult to return a file content as the http response.
ASP.Net - Global.asax Application_Start event does not fire  (542 Views)
Create New Account