简体   繁体   中英

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

In VS2010 the project's target framework is 4.0. In IIS7, localhost's .Net version is 4.0. But for my application's App Pool, there's no 4.0 framework available to choose from. 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. Once that is installed, you'll be able to set the app pool to use the .Net 4.0 framework.

The error message shows that it is trying to run your app using .Net 2.0 which can't process your web.config file.

You should install the .net 4 runtime on your server. if you already did run aspnet_regiis.exe

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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