Posted by: globbe on: May 29, 2010
Getting the following error when you deploy your first asp.net 4.0 website:
Unrecognized attribute ‘targetFramework’. Note that attribute names are case-sensitive.
is most likely because of either of 2 reasons:
Most often the above results in conflicting versions of the framework, and so the easiest way of solving this is to re-register the .NET extensions with IIS using the aspnet_regiss tool. Make sure you run it from an elevated command prompt and that you use the correct version (in the v4.xx folder that is, not the v2.xx one). On my dev machine this tool is located in:
C:\Windows\Microsoft.NET\Framework64\v4.0.30319
and you run it with the -iru flags like so:
aspnet_regiis.exe -iru
Change this using either the IIS Manager or the command line. In IIS Manager you select ‘Application Pools’, click the Application you’ve pointed you site to use, select ‘Basic Settings’ in the ‘Actions’ pane and change the ‘.NET framework version’.
This post over at MSDN should also be of great help. Gotta love Microsoft’s documentation!
http://msdn.microsoft.com/en-us/library/dd483478(VS.100).aspx
Totally what I was looking for.
Resolved my problem. Thanks!
am sorted thoroughly, thanks man
Hi guys, how are you? I’m still getting this error!!!
I’ve done everything I could to make it work, but it just won’t. Here’s my timeline for the past few days:
1) Running Win Vista IIS 7 .NET FW 2.0.
2) Formatted computer and installed Win 7 IIS 7.5 as well as all its features as well as VS2008. (in the hopes of targetFramework to work)
3) Installed .NET 4.0.
4) Started VS2008 and when I opened the localhost it said the site was using .NET FW 2.0 and asked me if I wanted to switch to 3.5. I said yes and the conversion was a success.
5) Tried to run site but got same error message.
6) Spent 3 days on the internet attempting to figure out what went wrong.
7) I did what you recommended. Restarted computer, also did not work. I’m getting desperate. Please help!
NOTE: When I try to start a new web site with VS2008, I do not have the option of picking .NET FW 4.0. Just 2.0 -> 3.5. What is going on!?!?
Thank you!
It helps me :)
Try this fix that worked for me. I posted the response here (search for ‘goHiker’):
http://forums.asp.net/p/1627935/4425127.aspx/1?p=True&t=634414101513664807
Regards… Terry
Really nice post. Resolved my problem :)
Thank you!
Dude I love you :D solved my problem. I installed .net 4.0 after IIS that was my problem! thank you!
Thanks a Lot man… Works like a cake..
Solved my problem. Thanks so much
Thanks a lot
This is excellent yaar….its helps me to run MVC 3.0 Razor app on IIS 7.
Thanks a Lot!
I had the same problem but using VS’ virtual server not IIS.
So here an article that could help you if you have the same problem:
http://extremedev.blogspot.com/2011/10/migrating-wdproj-from-vs-2008-to-vs.html
December 9, 2010 at 19:56
This is helpful. Thank you.
Best Regards,
Meganadha Reddy K.