I can't debug global.asax file!
I have some codes in Application_Start()
method but when I set a break point in the method, it is ignored!
Is this normal?
Global. asax is an optional file which is used to handling higher level application events such as Application_Start, Application_End, Session_Start, Session_End etc. It is also popularly known as ASP.NET Application File. This file resides in the root directory of an ASP.
asax is not required by ASP.NET for a website to run. It is, however, very useful for application-level functionality (like unhandled exception logging).
asax contains code which is executed. Web. config contains configuration settings of web application, for example connection string, included libraries, namespaces, users and groups access permissions to virtual directories, etc.
A simple way to break in Application_Start()
is to use the System.Diagnostics.Debugger
class. You can force the application to break by inserting System.Diagnostics.Debugger.Break()
where you would like the debugger to break.
void Application_Start(object sender, EventArgs e) { System.Diagnostics.Debugger.Break(); // ... }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With