Error: Configuration Error ... This error can be caused by a virtual directory not being configured as an application in IIS
After copying or installing a .NET web-application the following error is observed in the browser when trying to view the site:
Description: An error occurred during the processing of a configuration
file required to service this request. Please review the specific error
details below and modify your configuration file appropriately.
Parser Error Message: It is an error to use a section registered
as allowDefinition='MachineToApplication' beyond application level. This
error can be caused by a virtual directory not being configured as an application
Line 49: ...
Line 50: -->
Line 51: <authentication mode="Windows" />
Line 52: <!-- AUTHORIZATION
Line 53: This section sets ...
Source File: c:\inetpub\wwwroot\somewhere\web.config
This error is generated because the default set of configuration values in web.config require IIS to treat the web site as an application but this has not been configured.
- Run Internet Services Manager (under Control Panel > Administrative Tools)
- Find the project in the list of projects. (Open up your computer in the list and look under "Default Web Site").
- Bring up its properties (Right click > Properties).
- If the "application name" (under "Application Settings" on the "Directory" tab) is greyed out then click '[Create]' and then '[OK]'.
These notes have been tested on Windows 2000 Workstation and Windows 2003 server, and may apply to other versions as well.
About the author: Brian Cryer is a dedicated software developer and webmaster. For his day job he develops websites and desktop applications as well as providing IT services. He moonlights as a technical author and consultant.