Asp.net '中的服务器错误/';应用程序(目标框架)

Asp.net '中的服务器错误/';应用程序(目标框架),asp.net,.net-4.0,configuration,webserver,Asp.net,.net 4.0,Configuration,Webserver,我有一个在Framework3.5中开发的web应用程序。我改为更新版本的Framework4.0。如果我在本地主机上运行相同的程序,它运行得非常好,但是一旦我把它放到web服务器上,它就会给我以下错误 Configuration Error Description: An error occurred during the processing of a configuration file required to service this request.Please review the

我有一个在Framework3.5中开发的web应用程序。我改为更新版本的Framework4.0。如果我在本地主机上运行相同的程序,它运行得非常好,但是一旦我把它放到web服务器上,它就会给我以下错误

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:

<compilation debug="true" targetFramework="4.0">
配置错误
描述:处理配置文件时出错
服务此请求所需。请查看具体错误
请参阅下面的详细信息,并适当修改配置文件。
分析器错误消息:无法识别的属性“targetFramework”。
请注意,属性名称区分大小写。
源错误:

请帮帮我。在IIS服务器上安装.Net Framework 4.0的代码中,我需要做什么更改

当web.config中的属性为
targetFramework=“4.0”
但应用程序池设置为运行
ASP.NET 2.0
时,通常会发生这种情况

ASP.NET 2.0

  • 因此,将其更改为2.0不会产生预期效果
解决方案2:

右键单击您的网站,然后按

开始选项->构建选项卡->在组合框(.NET Framework 4)中选择目标框架

解决方案3:

还是问题坚持试试这个

你能做的就是对我有用的事情:

C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319>aspnet_regiis -i
看看这个:


希望这能解决您的问题。

您是否检查了
应用程序池
是否在
Framework 4.0
上运行?