1

大家好,当我通过 IIS 发布我的网站时,我收到此错误代码,如下所示。你能帮助我吗 ?

 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 27:       </assemblies>
    Line 28:     </compilation>
    Line 29:     <authentication mode="Forms">
    Line 30:       <forms loginUrl="~/Account/LogOn" timeout="2880" />
    Line 31:     </authentication>


    Source File: C:\Users\furkan\Desktop\WebCity\webcity\web.config    Line: 29 

然后我将我的根字典转换为应用程序,但我收到了这个错误

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: Unrecognized attribute 'targetFramework'. Note that attribute names are case-sensitive.

Source Error: 


Line 17:   <system.web>
Line 18:     <httpRuntime requestValidationMode="2.0" />
Line 19:     <compilation debug="true" targetFramework="4.0">
Line 20:       <assemblies>
Line 21:         <add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />


Source File: C:\Users\furkan\Desktop\WebCity\WebCity\web.config    Line: 19 
4

2 回答 2

1

第一个问题的答案是这样的:

这通常意味着您尚未将网站的目录配置为应用程序。打开 IIS 管理器,找到您网站的根目录(web.config 所在的位置),右键单击,然后选择“转换为应用程序”。

对于新问题,这是.NET版本的问题。您要么没有安装 asp.net 4.0,要么将应用程序池设置为使用错误的框架。可能是后者,所以转到您网站的高级设置,选择应用程序池设置,然后选择一个名为 ASP.NET 4.0 或任何其他使用 4.0 框架的应用程序池。如果没有,则需要安装 .NET 4.0

选择应用程序池:

于 2012-08-22T08:30:12.573 回答
0

您是否检查过某个子目录中是否有多个 web.config?在此处
描述问题的链接

于 2012-08-22T08:29:19.327 回答