Ever Notice Your Web Site Doesn't Load?
You've made some changes to your web site, and nothing comes up. Instead, you see some action going on in the status bar, where the status bar freaks out. What in the world is going on, you might ask?
Certain types of changes to the application cause severe issues that cause the application not to load. These could be database structure (which causes issues with your ORM if out of sync), framework-related, or architecture-related. To figure out what's going on, an easy way is to use health monitoring, if you have it enabled. It logs this information to the event handler for easy retrieval. For more information on health monitoring, check these out:
http://dotnetslackers.com/articles/sql/HealthMonitoring.aspx
http://msdn.microsoft.com/en-us/library/ms998306.aspx
The web.config file in the Windows/Microsoft.NET/<version>/Config folder contains the following event mappings (<eventMappings> element), which log internal .NET framework errors. These are already built-in to the .NET framework, and are specifically mapped to the event log.
<add name="All Errors" type="System.Web.Management.WebBaseErrorEvent,System.Web,Version=2.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a" startEventCode="0" endEventCode="2147483647"/>
By default, the event log provider is registered to handle these errors, so all errors will at least be logged to the event log. Going to the application event log will sniff out the error.
Depending on your architecture, there are various reasons why this happens. One of the reasons we experience is because a difference occurs between the database model and our LINQ model (using LINQ to SQL), and because of this LINQ throws an exception which prevents the application from loading. When querying using LINQ, the model differs from the database, the LINQ model detects this and throws an exception worded like: invalid column name <X>. Because this object being accessed throws the error from the master page, the error occurs in each and every page. Other errors could easily cause this to happen if vital enough.
So when your app may not load, instead of freaking out, check the event log. It will often directly prompt you to the issue, if you have health monitoring involved.