Click here to Skip to main content
15,886,075 members
Please Sign up or sign in to vote.
3.50/5 (2 votes)
See more:
I'm trying to access the website on my machine (running XP version 2002 SP3, IIS 5.1, with vs 2008 and I have installed dotnetframework 4.0) but I keep getting the following error:

Unrecognized attribute 'targetFramework'. Note that attribute names are case-sensitive

Line 33: roleManager
Line 34: compilation debug="true" strict="false" explicit="true" targetFramework="4.0"
Line 35: assemblies
Line 36: add assembly="System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"
assemblies
compilation

I've googled and attempted the various given solutions, i.e. run the command aspnet_regiis.exe -i and changed the version 4.0.30319 on iis manager

Any help would be massive!
Posted
Updated 10-Nov-11 19:33pm
v3
Comments
Amol_27101982, India 10-Nov-11 23:59pm    
Have you got any solution or not ??

This code is working fine

HTML
<compilation debug="true" targetframework="4.0"></compilation>


Compare your one with this
 
Share this answer
 
v2
Check the .NET version of Application pool in IIS. If application pool is running on .NET version 2 and the web.Config file specify .Net version 4, you get this error.
Note this may not be the only cause for your error. But check this.
 
Share this answer
 
Is .NET framework 4.0 installed on the server?

Did you create an application pool that uses .NET 4.0, and assign that app pool to your application?

BTW, how can you be targeting .Net 4 whith VS2008 when VS2008 doesn't support .Net 4?
 
Share this answer
 
v2
To resolve the problem simply go to the ASP.NET Version page in Control Panel to switch the framework to 4.0.
 
Share this answer
 
in menu

Website -> Start Options -> build tab – > Select Target Framework in combo box (.NET FrameWork 4)

By Elaiyaraja.R
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900