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 in IIS.
Source Error:
Line 44: ASP.NET to identify an incoming user. Line 45: --> Line 46: <authentication mode="Windows"> Line 47: <!-- Line 48: The <customErrors> section enables configuration |
Source File: C:/inetpub/wwwroot/testvalidateaspweb/web.config Line: 46
Version Information: Microsoft .NET Framework Version:2.0.50727.4016; ASP.NET Version:2.0.50727.4016
首先看看网站项目中的web.config文件是不是在根目录下, 再者, IIS的虚拟目录是否配置正确.
Windows Server 2008的IIS7.0虚拟配置需要右键点击Default Website, 选择”add application”来进行设置.
Windows Server 2000/2003等IIS5.0或6.0则需要在Default Website属性中的HomeDirectory中选择目录.
以下是解决: web.config文件在子目录下的设置方法:
修改web.config文件的部分代码如下:
<configuration>
<system.web>
<authorization>
<allow roles="administrators" />
<deny users="*" />
</authorization>
</system.web>
</configuration>