Thursday, September 3, 2009

HTTP Error 500.19 – Internal Server Error

A couple of times I have now run into this wonderful error after setting up a new EPiServer CMS site on a newly installed machine. However, I don’t think it’s specific to EPiServer CMS – but can occur in any asp.net application. The error message looks like this:

The requested page cannot be accessed because the related configuration data for the page is invalid.

As with many other microsoft errors, this is completely misleading (unless you’ve been messing up your configuration data – but this is a newly installed site).

The error message tries to clarify itself further:

Module
IIS Web Core

Notification
BeginRequest

Handler
Not yet determined

Error Code
0x80070021

Config Error
This configuration section cannot be used at this path. This happens when the section is locked at a parent level. Locking is either by default (overrideModeDefault="Deny"), or set explicitly by a location tag with overrideMode="Deny" or the legacy allowOverride="false".

Config File
\\?\C:\EPiServer\Sites\MyEPiServerSite3\web.config

 

By now, you are probably half way into your web.config, and trying to remember where that mystical machine.config is located. You might even have started to go through all directories on your machine in the search for another web.config thats somehome conflicting. Stop looking. It’s not conflicting. And relax – you didn’t do anything wrong…yet.

One of 2 things have likely happened:

1) IIS was installed after ASP.NET, and it’s not really sure what to do with ASP.NET code. Solution: In a command prompt run aspnet_regiis. It’s typically found in “%windows%\Microsoft.Net\Framework\v2.0.50727\aspnet_regiis –i”. Note that you need to run it as Administrator on Vista and Windows 7. In fact, running this can be a cure for many initial web server errors on newly installed asp.net applications.

2) You are running Windows 7 or Windows Server 2008 and you selected the default install of IIS7.5. For reasons known only to Microsoft, they decided that ASP.NET shouldn’t be included in a default installation. My personal theory is that the guy who made that wise call is probably the same guy who decided to remove the ability to drag files onto a command-prompt in Vista. And before that was the mastermind behind the “Copy File” feature in any earlier version of Windows. But I digress :-) Solution in this case is easy – Open Control Panel | Programs | Turn Windows Features on and off, find IIS and enable ASP.NET:

image

Hit “Ok”, wait for half an hour and then see your web application spring to life. Enjoy!

1 comment:

Maria Dahlin said...

Thanks, this really helped! I had the exakt same problem with EPiServer CMS on a new Windows 7 installation. Luckily I googled before I started messing with the config files...