VS2005中有web.config程序,程序运行时出现配置错误该如何配置??

来源:百度知道 编辑:UC知道 时间:2024/05/15 07:08:30
“/电子购物商城”应用程序中的服务器错误。
--------------------------------------------------------------------------------

配置错误
说明: 在处理向该请求提供服务所需的配置文件时出错。请检查下面的特定错误详细信息并适当地修改配置文件。

分析器错误信息: 在应用程序级别之外使用注册为 allowDefinition='MachineToApplication' 的节是错误的。如果在 IIS 中没有将虚拟目录配置为应用程序,则可能导致此错误。

源错误:

行 2: <configuration>
行 3: <system.web>
行 4: <authentication mode="Forms">
行 5: <forms name="eshop" loginUrl="signIn.aspx" protection="All" path="/"/>
行 6: </authentication>

源文件: E:\zhudy\电子购物商城\电子购物商城\eshop\web.config 行: 4

这里用的是表单验证,验证正确转向了signIn.aspx页面,解决办法
依次检查子文件夹是否存在web.config文件,有则删除
修改行 2: <configuration>
行 3: <system.web>
行 4: <authentication mode="Forms">
行 5: <forms name="eshop" loginUrl="signIn.aspx" protection="All" path="/"/>
行 6: </authentication>

为:
<configuration>
<system.web>
<authentication mode="None">

</authentication>

把IIS设置一下就行了。