7
votes

I just installed visual studio 2010 but when i create a new project Framework 4 does not appear in the options for target framework. I know framework 4 installed correctly because the new app pools set to v4 were created in IIS. For some reason it's just not showing up in visual studio. I tried repairing dotnet 4 and reinstalling visual studio but still no luck. Anyone else have this problem or know how to fix it?

12
What project are you trying to create?Vladislav Rastrusny
Any type of project with .net 4.0sagescrub

12 Answers

8
votes

First of all you shoul use the .NET Framework Setup Verification Tool to check the .NET 4 have been properly installed.

I also recommend you to check the both products language, sometimes it could be the problem.

If everything is ok, i guess you have registry problem, so you would have to check the installation keys or use .NET uninstall tools.

More info:

Detection keys for .NET Framework 4.0 and Visual Studio 2010

Uninstall .NET Framework Tool

Visual Studio does not detect .NET Framework 4

Hope helps!

7
votes

I had the same problem and it turned out to be that I needed the Microsoft .NET Framework 4 Multi-Targeting Pack. No other combination of actions would fix this.

6
votes

I tried all the ways but no success, According to this link,you can solve this problem by copy frameworklist.xml file from another computer and paste it in your system.

I had the same problem and I resolved it. I found out that there were no file FrameworkList.xml in folder C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\RedistList. But I noticed this file in machine where .Net Framework 4 is accessible from VS 2010. Then I copied this file to my computer and restarted VS 2010. And .Net Framework 4 appeared from drop down list.

I attached frameworklist.xml file from my system :Download frameworklist.xml

3
votes

Changes which lead to missing .Net4 problem:
1.
I changed some registry settings in
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion
CommonFilesDir
CommonFilesDir (x86)
CommonW6432Dir
ProgramFilesDir
ProgramFilesDir (x86)
ProgramW6432Dir
All those were moved from C: drive to another drive (E: in my case)

2.
I changed the location of some user folders:
C:\Users\<name>\AppData\LocalLow
C:\Users\<name>\AppData\Roaming
Those were moved (via Properties->Path->"Move" button) from C: drive to F: drive.

After reverting 1. back to drive C:
and creating symbolic links in C:\Users\<name>\AppData to the new locations,
it worked again (note: I uninstalled VS before reverting the changes, and installed again afterwards)
(Create link with: mklink /d C:\Users\<name>\AppData\LocalLow E:\Data\LocalLow)

I can not say if both changes are really needed, because I changed both at once.
But finally it works again ;)

Greetings,
Frostregen

2
votes

I'm seeing the same problem. We were using my build box to test installs of a WinForms app on a machine without 4.0. We bundled 4.0 in the manifest and the app works, Framework 4 Client Profile and Framework 4 Extended show up in add/remove programs, but there is still no 4.0 Framework in the VS2010 options.

BTW, reloading SP1 was no help.

I finally got this working by running the VS2010 setup in repair mode. I now see Framework 4.0 options in VS2010.

That was a long and tedious process and now I have to patch to SP1 again. MSFT should fix this behavior in a SP soon.

2
votes

Had the same problem. Numerous uninstalls and reinstalls of visual studio 2010 and the .NET 4.X frameworks didn't fix it.

Manually uninstalling the "Microsoft Visual Studio Macro Tools" item and then doing a repair install of VS2010 seems to have done the trick.

1
votes

I had the same problem this week and it got resolved by installing Visual Studio 2012 RC.

Removing and reinstalling .NET Framework 4 didn't help and I couldn't reinstall Visual Studio 2010. After installing the 2012 RC the Framework 4

1
votes

I had installed .NET 4.5, which ended up breaking something, so decided to uninstall. VS 2010 could not longer see .NET 4.0. I tried using the .NET cleanup tool and reinstalling, but no go.

Eventually what worked was what is posted at http://social.msdn.microsoft.com/Forums/eu/netfxsetup/thread/3dede142-82ce-430c-bbe6-d824f0fb94a4. I installed Windows Phone Developer Tools (http://www.microsoft.com/en-us/download/details.aspx?id=13890) up until the multi-targeting package, at which point I canceled installation.

1
votes

You can reinstall the targeting pack using this command, this solved my issue:

Microsoft .NET Framework 4 Multi-Targeting PAck

WCU\MTPack

COMMAND--> NetFx_DTP.msi EXTUI=1 /log "%TEMP%\dd_netfx_dtp.txt"

0
votes

I think it's because you installed higher version of .net framework, such as .net framework 4.6, Which caused the mistake of missing .net framework 4.0.

0
votes

For me using Arash's fix worked "there were no file FrameworkList.xml in folder C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.0\RedistList". I noticed I had other .NET versions and just copied the FrameworkList.xml from one of those to 4.0 RedistList folder and it worked.

-1
votes

Problem:

VS2010 ->Right Click on Project -> Property Pages - > Build->Target Framework 

is showing up to .NET 3.5 only. I have installed up to .NET 4.5 framework.

Solution: I tried many solutions and decided to take a drastic step to format. The following way I got the solution without formating o/s.

  • Removed all .NET installations
  • Installed one by one from 1.0 to 4.6 with sps available.
  • VS2010 setup with repair option selected.
  • Opened vs2010 project and .NET framework up to 4.0.3 found in the list.

Regards, S.SREENIVAS RAO