Friday, October 19, 2012

Virtual directory not being configured as an application in IIS

Virtual directory not being configured as an application in IIS

Problem

01.Configuration Error
02.Description: An error occurred during the processing of a configuration
03.file required to service this request. Please review the specific error
04.details below and modify your configuration file appropriately.
05. 
06.Parser Error Message: It is an error to use a section registered as
07.allowDefinition='MachineToApplication' beyond application level. 
08.This error can be caused by a virtual directory not being configured
09.as an application in IIS.
10. 
11.Source Error:
12. 
13. 
14.Line 53:
15.Line 54: 
16.Line 55:
17.Line 56:

Solution

Change authentication mode to 'None' in web.config.

Go to your web.config file and change following line

1. 
to
1.< authentication mode="None" />

This should solve this problem.

Note: If above solution does not work then make sure that the directory from where you website is running is configured as an application in IIS. To do this, you need to go into IIS and find your project folder on the server, right click to Properties. Under Application Settings click Create.

Cause

By default ASP.Net creates Windows authentication mode in Web.Config file. When you run this site locally on your computer, it runs fine. This is because it runs under current windows account credentials (i.e. Your windows login which may have administrative rights). But when you copy it to web server it runs under [MACHINENAME]\ASPNet account. If it does not have appropriate rights, server will throw this error.

No comments:

Post a Comment