views:

124

answers:

2

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

A: 

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.

David
A: 

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

Jeroen
I am deploying the application on the dev machine itself. It works fine while debugging though. Doesn't it mean I have .Net FW 4.0 runtime installed?
Reddy S R
During debugging you're probably using the VS built in webserver which is not IIS. run aspnet_regiis.exe
Jeroen