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" targetFramew开发者_StackOverflow社区ork="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 should install the .net 4 runtime on your server. if you already did run aspnet_regiis.exe
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.
If .Net 4.0 is available please go to Server IIS Manager and select "Application Pool" and make the .Net framework as 4.0 for your website.
精彩评论