奇怪(但需要帮助) - 无法识别的属性'targetFramework'。请注意,属性名称区分大小写

时间:2015-11-21 00:56:19

标签: c# asp.net .net web-applications iis-7

我使用.net framework 4.5构建了一个网站。这是Web.config文件中的代码片段。

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

我在本地计算机IIS7中托管了同一个网站。在创建新网站时,我选择的应用程序池为4.0。当我尝试从浏览器访问相同内容时,我遇到错误。

   Server Error in '/' 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 14:   -->
   Line 15:   <system.web>
   Line 16:     <compilation targetFramework="4.5"/>
   Line 17:     <httpRuntime/>
   Line 18:     <pages controlRenderingCompatibilityVersion="4.0">

   Source File: C:\inetpub\wwwroot\polygontechnologies.com\web.config    Line: 16 

   Version Information: Microsoft .NET Framework Version:2.0.50727.5485; ASP.NET Version:2.0.50727.5491

所以,到目前为止,我在web.config和IIS应用程序池中有targetFramework =“4.5”,它是4.0。

任何人都可以帮我解决问题。 TIA

1 个答案:

答案 0 :(得分:1)

尝试更改您的应用池以使用framework 4.0

如果这不起作用,请尝试aspnet_regiis -i

相关问题