2012-08-22 116 views
1

大家好,当我通过IIS发布我的网站时,我收到了这个错误代码,你可以在下面看到。你可以帮我吗 ?关于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 
+0

现在这是一个不同的问题。第一个问题是您的网站不是应用程序。现在,您或者没有安装Asp.Net 4.0,或者您的应用程序在IIS中配置为使用Asp.Net 2.0。我会编辑我的答案。 – JcFx

回答

1

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

这通常意味着你还没有配置目录为您的网站作为一个应用程序。打开IIS管理器,找到您的网站的根目录(web.config位置),右键单击并选择“转换为应用程序”。

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

Choosing an app pool:

+0

我转换的根目录,但我得到错误,我会编辑我的问题,你会看到 –

+0

已更新的答案。 – JcFx

+0

非常感谢 –

0

没有,如果你在一个子目录有多个web.configs地方你检查?
链接描述该问题here