奇怪(但需要帮助) - 无法识别的属性'targetFramework'。请注意,属性名称区分大小写。 [英] Strange (but need help)- Unrecognized attribute 'targetFramework'. Note that attribute names are case-sensitive.
问题描述
大家好,
我使用.net framework 4.5构建了一个网站。以下是Web.config文件中的代码段。
Hi All,
I have built one website using the .net framework 4.5 . Here is the code snippet from the Web.config file.
<compilation debug="true" targetFramework="4.5"/>
我在本地计算机IIS7中托管了同一个网站。在创建新网站时,我选择的应用程序池为4.0。当我尝试从浏览器访问相同内容时,我收到以下错误。
I have hosted the same website in my local machine IIS7. While creating a new website, Application pool I selected as 4.0. When I try to access the same from the browser I am getting below error.
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
所以,截至目前我有targetFramework = web.config和IIS应用程序池中的4.5是4.0。
任何人帮我解决问题。
So, as of now I have targetFramework="4.5" in web.config and in IIS application pool it is 4.0.
Anybody help me in fixing the issue.
推荐答案
虽然你已经清楚地提到你在应用程序池中选择了
.NET Framework Version = v4.0.XXXXX,但是你的错误说你仍然有.NET Framework版本=选择了v2.0.XXXXX。
再次访问IIS并查看。
Although you have clearly mentioned that you have selected
.NET Framework Version = v4.0.XXXXX in application pool, but your error says you still have .NET Framework Version = v2.0.XXXXX selected.
Go to the IIS again and check.
IIS -- Right Click on your hosted website -- Advanced Settings -- Application Pool -- Select version 4.0
如果这不起作用,请确保已在系统中安装.Net framework 4.5。
如何找到.NET版本? [ ^ ]
希望,它有帮助:)
If this doesn't work then make sure that you have installed .Net framework 4.5 in your system.
How to find the .NET version?[^]
Hope, it helps :)
这篇关于奇怪(但需要帮助) - 无法识别的属性'targetFramework'。请注意,属性名称区分大小写。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!