ASP.NET 4.0 Hosting | How to Troubleshoote ASP.NET 4 Application Restarts using HealthMonitoring

monitoring

After some days evaluating why a little ASP.NET Web Forms application was loosing session variables, I found this useful setting as known as Healthmonitoring. Now, I will describe to you “How Healthmonitoring Works”. There are several reasons why an application suffers a restart: web.config changes, new sending, antivirus and lots of others. Every issue could have an alternate solution but your first approach ought to be find the cause behind why the problem happens, this is how Healthmonitoring helps us.

Setup HealthMonitoring in web.config to Write Value in Event Viewer:

 Start your application and check the windows event viewer for messages like:

Application Start:

Event code: 1001
Event message: Application is starting.
Event time: 06/11/2014 15:07:20
Event time (UTC): 06/11/2014 21:07:20
Event ID: 2632880960c2437587b68c2a04b62ecf
Event sequence: 1
Event occurrence: 1
Event detail code: 0

Application information:
Application domain: /LM/W3SVC/1/ROOT/APP/CRM-10-130597815961548595
Trust level: Full
Application Virtual Path: /APP/CRM
Application Path: C:\inetpub\wwwroot\APPS\CRM\
Machine name: IIS1

Process information:
Process ID: 24504
Process name: w3wp.exe
Account name: NT AUTHORITY\NETWORK SERVICE

Application Compilation:

Event code: 1003
Event message: Application compilation is starting.
Event time: 11/6/2014 2:44:32 PM
Event time (UTC): 11/6/2014 8:44:32 PM
Event ID: 969af5a8e9e9459fb451e230eaa2d5d0
Event sequence: 3
Event occurrence: 2
Event detail code: 0

Application information:
Application domain: /LM/W3SVC/1/ROOT/APP/CRM-9-130597801772791291
Trust level: Full
Application Virtual Path: /APPs/CRM
Application Path: C:\inetpub\wwwroot\APPs\CRM\
Machine name: IIS1

Process information:
Process ID: 24504
Process name: w3wp.exe
Account name: NT AUTHORITY\NETWORK SERVICE

Application Restart Due to Configuration Changes

Event code: 1002
Event message: Application is shutting down. Reason: Configuration changed.
Event time: 11/6/2014 3:06:35 PM
Event time (UTC): 11/6/2014 9:06:35 PM
Event ID: d9ebddf38dff4a12b61487ea842f665f
Event sequence: 10
Event occurrence: 1
Event detail code: 50004

Application information:
Application domain: /LM/W3SVC/1/ROOT/APP/CRM-9-130597801772791291
Trust level: Full
Application Virtual Path: /APPs/CRM
Application Path: C:\inetpub\wwwroot\APPs\CRM\
Machine name: IIS1

Process information:
Process ID: 24504
Process name: w3wp.exe
Account name: NT AUTHORITY\NETWORK SERVICE

With the information above and why the appliance is suffering continuous restarts ought to a lot of easier.

Leave a Reply

Your email address will not be published.