HTTP Error 500.0 is an error message that fills me with dread. More often than not it can take ages to track down what the actual cause of the error is. Sometimes it can be a result of something pretty obscure. Sometimes it can be a result of something just plain silly. A Doh! moment if you will

Today I had a Doh! moment and thankfully I had the common sense to step in to the debugger and not go off on a wild goose chase which is easily done.

Having just added some new functionality to the Application_BeginRequest method of the Global.asax I had created a new method written inside a logic check that was generated using the Visual Studio 'Generate Method' refactoring tool.

This very kindly adds a 'throw new NotImplementedException();' for us to remind us we have not done the work yet and this was the culprit.

Although I had written the code for the method I had not removed this from the end of the method. Under normal circumstances you would see this error appear but when it's down in the bowels of BeginRequest and gets thrown IIS gives us the HTTP Error 500.0 and this can send you off on a wild goose chase.

The lesson to take from this: consider what has changed and look there first before going off on a wild goose chase.