简体   繁体   English

IIS7 / Win7 .Net 4.0中ASP.Net网站的运行时问题

[英]Runtime problems for ASP.Net website in IIS7/Win7 .Net 4.0

In VS2010 the project's target framework is 4.0. 在VS2010中,项目的目标框架是4.0。 In IIS7, localhost's .Net version is 4.0. 在IIS7中,本地主机的.Net版本为4.0。 But for my application's App Pool, there's no 4.0 framework available to choose from. 但是对于我的应用程序的应用程序池,没有可供选择的4.0框架。 And after I deploy the site and browse a file from it, I get this error: 在部署站点并从中浏览文件后,出现此错误:

Parser Error Message: Unrecognized attribute 'targetFramework'. Note that attribute names are case-sensitive.

Source Error:

Line 14: 
Line 15:   <system.web>
Line 16:     <compilation debug="true" targetFramework="4.0" />
Line 17: 
Line 18:     <authentication mode="Forms">


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

Version Information: Microsoft .NET Framework Version:2.0.50727.4927; ASP.NET Version:2.0.50727.4927 

Please help me out. 请帮帮我。

Thanks Reddy 谢谢雷迪

You need to install .Net 4.0 on the server. 您需要在服务器上安装.Net 4.0。 Once that is installed, you'll be able to set the app pool to use the .Net 4.0 framework. 安装完成后,您将可以将应用程序池设置为使用.Net 4.0框架。

The error message shows that it is trying to run your app using .Net 2.0 which can't process your web.config file. 错误消息表明它正在尝试使用无法处理web.config文件的.Net 2.0运行您的应用程序。

You should install the .net 4 runtime on your server. 您应该在服务器上安装.net 4运行时。 if you already did run aspnet_regiis.exe 如果您已经运行过aspnet_regiis.exe

如果.Net 4.0可用,请转到“服务器IIS管理器”并选择“应用程序池”,然后将.Net框架设为4.0。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM