Saturday, June 26, 2010

Broken ASP.NET applications in Vista / IIS 7.0

When publishing an ASP.NET app to your IIS 7.0 server, HTTP 500.19 Error messages might indicate a broken IIS registration for the .NET Framework

Who doesn't love a good Internal Server Error? How about this beauty?

HTTP Error 500.19 - Internal Server Error
The requested page cannot be accessed because the related configuration data for the page is invalid.
Detailed Error Information
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:\inetpub\wwwroot\web.config


This error can spew forth if you're trying to publish your ASP.NET w/ AJAX application to IIS 7.0 and something is amiss with your .NET 2.0 (or possibly 3.0 or 3.5) registration in IIS.

It may be time to re-register the .NET framework in IIS with this command:

%windir%\Microsoft.NET\Framework\v(.NET VERSION HERE)\aspnet_regiis.exe -i

However, if you're in the mood to tinker, you can try editing the %windir%\System32\inetsrv\config\applicationHost.config file, where you'll find a line that reads:

Just change this to "Allow" if your error referred to the "" section in your web.config file.

Similarly, if the error was really about the "" section of the web.config, then look at changing this line to "Allow":


If things are truly not well with your .NET registration, then you might still see this kind of an error:

HTTP Error 404.3 - Not Found
The page you are requesting cannot be served because of the extension configuration. If the page is a script, add a handler. If the file should be downloaded, add a MIME map.
Detailed Error Information
Module StaticFileModule
Notification ExecuteRequestHandler
Handler StaticFile
Error Code 0x80070032


... and if that's the case, it's probably time to stop messing around under the hood and hope that the "aspnet_regiis.exe -i" command solves your problems. In Vista, .NET is tightly intertwined with the operating system, so reinstall attempts can result in tail-chasing and messages like "Error: Product already installed . . . This product is already installed as part of the operating system."

No comments:

Post a Comment