2012-10-28 147 views
0

这是一个常见的错误,已经在SO上多次讨论过,但在发送给其他答案之前,请阅读下面的情况。错误的架构作为目标无法识别的属性'targetFramework'属性名称区分大小写

编辑:。发生的错误,如果在web.config目标 “4.0” 或 “4.0.3”,无论是一个

在Visual Studio 2010(在Win 7 64位系统)我有进入高级编译选项并从Target Frameworks下拉列表中选择“Install other Frameworks”,该过程从Microsoft网站下载4.0.3框架,安装过程需要几分钟时间并需要重新启动。已装载,已安装并重新启动。

然后我进入我的应用程序在Visual Studio 2010中,针对4.0.3框架,这一步需要关闭和重新打开项目,我做了。然后我重建了这个项目。我可以在Visual Studio中成功运行该应用程序。然后我发布了该应用程序。但它不能直接在浏览器中运行。我收到下面的错误。只是为了确保,我重新注册的框架收到错误后,却没有喜悦:

cd C:\Windows\Microsoft.NET\Framework\v4.0.30319 
iisreset /stop 
aspnet_regiis -i 
iisreset /start 


====================================== 
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 9: </connectionStrings> 
Line 10: <system.web> 
Line 11:  <compilation strict="false" explicit="true" targetFramework="4.0.3" /> 
Line 12:  <authentication mode="None" /> 
Line 13:  <membership> 
+0

你试图用你的本地iis运行这个吗? – peroija

+0

@peroija:是的,本地。 – Tim

+0

@Tim你找到了解决方案吗?如果是这样,请发布并接受。 –

回答

0

你为targetFramework输入的值,4.0.3无效。

从文档上<compilation> element

targetFramework="2.0|3.0|3.5|4.0" 

所以,只是下降的.3,你应该罚款。

+0

如果我放下“.3”并指定“4.0”,我会得到相同的错误 – Tim

+0

@Tim - 在哪个.NET版本的应用程序池/网站下运行? – Oded

相关问题