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

asp.netIis 7Web Config

asp.net Problem Overview


I just installed vs 2010, followed by IIS in window 7. when building a website in .net framework 4.0 and convert this into application in IIS then its shows this error

enter image description here

If i remove the targetFramework="4.0" from web config file then it shows me a second error which is related to linq reference error

enter image description here

This all happening when i am using localhost to run my website but whenever i use just f5 in vs 2010 then its run perfectly.

When i want to attach my process with aspnet_wp.exe i don't find this process in my list.

I searched a lot of answers here. What am I missing.

asp.net Solutions


Solution 1 - asp.net

The problem could be:

  • the Application Pool for your site is configured for .NET Framework Version = v2.0.XXXXX
  • .NET 4 isn't installed on your server.

See also

... which helped me fix a similar issue.

Solution 2 - asp.net

You'll likely need to re-register ASP.Net version 4 with IIS.

Navigate to your .net framework 4.0 folder, and run aspnet_regiis.exe -i

For example, my .net framework 4.0 folder (Server 2k8 R2 x64) was located at: C:\Windows\Microsoft.NET\Framework64\v4.0.30319

Solution 3 - asp.net

From Control Panel open IIS manager -> on Left side select "Application Pools" -> Now on middle part your project listing display then select your project e.g. "MvcApplication1" -> from right side select "set Application Pool Defaults" -> Now change .Net Framework Version from V2.0 to V4.0

This one is work for me but make sure you have already installed .Net Framework 4.0 .

Solution 4 - asp.net

Run the following command to fix this problem.

Start --> Run:

%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe –i

If you get an error about ADMIN rights you need to do the following.

1. CTRL+SHIFT+ENTER from the RUN menu will run as ADMIN
2. START --> PROGRAMS --> ACCESSORIES --> Right-click on command prompt and "run as administrator"

Solution 5 - asp.net

You can also open your projects property pages in VS, and in "Build" section choose as "Target Framework" - .NET Framework 4. It helped me with the same issue.

Solution 6 - asp.net

Open your IIS, click on your application pool and change the settings there. Click the defaultAppPool and check the .Net Clear version if version 4.0 is present. you can perhaps change the pipeline mode to integrated.

Solution 7 - asp.net

  • Your current .Net Framework version 2.0.
  • .Net Framework Version 4.0(or more than 4.0) is not installed on your server.
  • Update your .Net Framework Version. If not solved yet, you have to change your IIS .Net Framework Version settings and select the .Net Framework Version 4.0.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionrahularyansharmaView Question on Stackoverflow
Solution 1 - asp.netMerenzoView Answer on Stackoverflow
Solution 2 - asp.netTomView Answer on Stackoverflow
Solution 3 - asp.netDilip0165View Answer on Stackoverflow
Solution 4 - asp.netJim FinnView Answer on Stackoverflow
Solution 5 - asp.nethotfusionView Answer on Stackoverflow
Solution 6 - asp.netJohnwendy EzealaView Answer on Stackoverflow
Solution 7 - asp.netRoman HossainView Answer on Stackoverflow