发布有关IIS错误的网站

时间:2012-08-22 08:24:43

标签: asp.net

大家好,当我通过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 

然后我将我的根词典转换为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: 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 

2 个答案:

答案 0 :(得分:1)

第一个问题的答案是:

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

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

Choosing an app pool:

答案 1 :(得分:0)

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