【问题标题】:How to solve the following errors in Web.config如何解决 Web.config 中的以下错误
【发布时间】:2012-10-03 13:39:38
【问题描述】:

这是运行时发生的错误

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 25:             ASP.NET to identify an incoming user. 
Line 26:         -->
Line 27:        <authentication mode="Forms"/>
Line 28:        <!--
Line 29:             The <customErrors> section enables configuration 

Source File: F:\Final Event Management\event management\web.config    Line: 27 

这是产生错误的编码

<?xml version="1.0"?>

<configuration>
    <appSettings/>
    <connectionStrings/>
    <system.web>

        <compilation debug="true" targetFramework="4.0">
        </compilation>

        <authentication mode="Forms"/>

        <pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"/></system.web>

</configuration>

请解决这个问题......

【问题讨论】:

  • 尝试清理和重建。它曾经对我有用。
  • 有一个类似的帖子...stackoverflow.com/questions/2355947/…>试试看有没有帮助..

标签: asp.net


【解决方案1】:

创建一个虚拟目录,看看是否能解决问题:

How to: Create IIS Virtual Directories in Visual Studio

在解决方案资源管理器窗口中右键单击项目节点并选择“属性”,然后选择“Web”选项卡,您应该会看到一个为您的站点创建虚拟目录的按钮。

【讨论】:

  • 右键项目节点,选择属性
猜你喜欢
  • 1970-01-01
  • 2012-04-07
  • 1970-01-01
  • 1970-01-01
  • 2015-07-04
  • 1970-01-01
  • 2015-07-04
  • 1970-01-01
相关资源
最近更新 更多