web.config中<authentication mode="Windows"/>错误

Server Error in '/' Application.


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 42: <add assembly="CrystalDecisions.ReportAppServer.Controllers, Version=11.5.3300.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/></assemblies>



Line 43: </compilation>



Line 44: <authentication mode="Windows"/>
Line 45: <!--<identity impersonate="true"/>-->

Line 46:                   <customErrors mode="Off" defaultRedirect="~/en/login.asp">

Source File: c:"inetpub"wwwroot"promis"web.config    Line: 44

  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. (c:"inetpub"wwwroot"promis"web.config line 44)

最近我们的网站偶尔会出现上面的错误。

我整理了一下出现这个错误的解决方案:

1。 在iis中项目文件夹设定为虚拟目录   

  在iis下找到项目文件夹属性->目录->应用程序设置处   点击   创建 

2。 在站点下面有多个配置文件(web.config)。

    删除子目录中的多余文件。

3。 如何配置应用程序的身份验证策略。

    a、启动互联网信息服务(IIS)。
    b、右键点击你的应用虚拟目录,然后单击属性。
c、点击这个目录安全标签。
    d、在匿名访问控制和认证,点击编辑。

  e、确保匿名访问复选框是未被选中,集成的windows认证被选择。(如果是asp和asp.net混合的站点,那么匿名访问也必须被选择。)

    f、 web.config需要<authentication mode="Windows"/>

To resolve this issue you would have to open the main .SLN file in notepad and replace the sections:

Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "C:"..."MySite"", "C:"Inetpub"wwwroot"MySite",

 with

Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "http://localhost/MySite/", "http://localhost/MySite",

and also if missing, add


  SlnRelativePath = "c:"inetpub"wwwroot"MySite""

4. 虚拟目录的权限需要设置ASPNET, IIS匿名, NetWork Service三个用户的权限。

 

posted @ 2009-04-29 13:50  空紫竹  阅读(609)  评论(0编辑  收藏  举报