解决: 访问IIS服务器网站的Configuration错误

Configuration Error

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 2008IIS7.0虚拟配置需要右键点击Default Website, 选择”add application”来进行设置.

Windows Server 2000/2003IIS5.06.0则需要在Default Website属性中的HomeDirectory中选择目录.

 

以下是解决: web.config文件在子目录下的设置方法:

修改web.config文件的部分代码如下:

<configuration>

<system.web>

<authorization>

<allow roles="administrators" />

<deny users="*" />

</authorization>

</system.web>

</configuration>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值