Wednesday, November 30, 2016

How to debug application_start global.asax in ASP.net

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();
    }
    
Or else
  1. Attach the debugger to the IIS process.
  2. Open the global.asax file and put in a break point.
  3. Add a space to the web.config file and save the file (this causes the current web application to reset);
  4. Refresh / goto a web page on the site.
  5. Boom debugger stops at your break-point. :)

8 comments:

  1. Nice site....Please refer this site also Our vision success!Training are focused on perfect improvement of technical skills for Freshers and working professional. Our Training classes are sure to help the trainee with COMPLETE PRACTICAL TRAINING and Real time methodologies
    Dot Net Training And Placement in Chennai | Best Dot Net Training in Chennai
    Software Testing Training Institute in Chennai | Best Software Testing Training Institute in Chennai
    Java Classes in Chennai | Java Training with Placement | Java Training Institutes in Chennai with 100 Placement
    PHP Course in Chennai | PHP Certification in chennai | PHP Training Institutes

    ReplyDelete
  2. Awesome blog! Do you have any suggestions for aspiring writers? I'm hoping to start my own website soon but I'm a little lost on everything. Would you suggest starting with a free platform like Wordpress or go for a paid option? There are so many choices out there that I'm completely confused .. Any recommendations? Thanks a lot!
    computer it support perth

    ReplyDelete
    Replies
    1. As a start, you may start with a free version. once you finalized the scope or the content that you are gonna write, you can choose themes and install that in your site. I preference is Google Blog :)

      Delete
  3. thank you so much for this nice information Article, Digital marketing is tha good skill in grouth tha career For website creation, promotion and development contact here. For your digital marketing needs just have a look at Click Perfect.Dot Net Training in Bangalore


    ReplyDelete
  4. Hi just wanted to give you a quick heads up and let you know a few of the pictures aren't loading correctly. I'm not sure why but I think its a linking issue. I've tried it in two different internet browsers and both show the same results.apple support berlin

    ReplyDelete
  5. Thank you for sharing this amazing post. Looking forward to reading more.
    Visit us: dot net training
    Visit us: Dot Net Online Training Hyderabad

    ReplyDelete