8

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?

sagescrub
  • 549
  • 1
  • 8
  • 20

12 Answers12

9

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!

Morvader
  • 2,317
  • 3
  • 31
  • 44
  • Morvader, thanks for your helpful comments. I tried uninstalling .net 4.0 and VS10 and reinstalled VS10, letting it install .net. I validated the installations, however when I checked the registry entries the VS10 entries were missing. I added them manually and .net 4.0 still doesn't appear in the options for creating a new project. Any ideas? Reinstalling windows is my last resort! – sagescrub Mar 14 '11 at 19:41
  • @Noel, are you installing the FW 4.0 Client Profile or the complete version? – Morvader Mar 16 '11 at 19:28
  • As far as I know I installed the complete version. How do I check this? – sagescrub Apr 08 '11 at 17:08
7

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

KyleMit
  • 30,350
  • 66
  • 462
  • 664
Arash
  • 3,013
  • 10
  • 52
  • 74
  • 1
    This is the working solution that work with my version Visual Studio 2010. Thank you so much! – ahmadnaziF Apr 13 '16 at 08:29
  • In my case, not only `FrameworkList.xml` was missing, but also all the DLLs under `C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\RedistList` were missing. Copying the XML and the DLLs from another machine solved it. – Alex Sanséau May 10 '18 at 16:27
  • Nice work, this fixed the problem for me, tried everything else on the internet. Incidentally, wth Microsoft, i have had countless problems with the target version selector in vs over the years. – petey m Jun 25 '20 at 15:17
  • This solution worked for me as well in 2023 (lol). Copied RedistList from a Win7 machine. – szx Feb 09 '23 at 04:19
7

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.

skaz
  • 21,962
  • 20
  • 69
  • 98
  • Thanks for your input skaz! I thought this was already included in VS. How did you install or fix the multi-targeting pack for framework 4? – sagescrub Mar 17 '11 at 16:33
  • 1
    This should have been included in VS - I had uninstalled it in an attempt to fix something else. It installed when I installed: http://www.microsoft.com/downloads/en/details.aspx?FamilyID=04704acf-a63a-4f97-952c-8b51b34b00ce – skaz Mar 21 '11 at 17:31
  • So I installed the Windows Phone Developer Tools and now I can create windows phone projects, but still no .net 4.0. – sagescrub Apr 08 '11 at 17:45
  • Worked for me on Windows7x64 machine. Thanks! – Michal B. Feb 07 '13 at 08:47
3

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

Frostregen
  • 54
  • 2
  • That was it for me! I had moved the program files x86 & 64 to a different drive. I hadn't touched common files or appdata. Uninstalled everything related to VS, changed the default program files back to C and reinstalled, now .NET 4 shows up. Thank you, thank you for sharing! – sagescrub Jun 24 '11 at 19:23
2

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.

user1791422
  • 31
  • 1
  • 3
2

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.

Kevin Raffay
  • 842
  • 5
  • 18
  • Thanks for your input Kevin. I did the repair and it's still not showing .net 4.0 unfortunately. – sagescrub Apr 08 '11 at 17:04
  • You need to remove .net 4.0 and then reinstall it. Repairing it won't do the trick unfortunately. Then do a repair of VS 2010, and then reapply VS 2010 SP1 – Anonymous Type Aug 22 '11 at 04:34
1

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

masentaa
  • 11
  • 1
1

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.

bleh
  • 121
  • 3
  • I installed VS2012 that automatically installed framework 4.5. I ended up with a weird bug when creating an AppDomain. I went back in time thanks to my Mercurial repo, but still the same bug. I decided to removed .Net 4.5 and reinstall 4, but VS10 would tell me 4 was missing. I used the Win Phone Dev Tools and its multi-targeting package, and now everything is back to normal. – user276648 Oct 05 '12 at 01:01
1

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"

chongo2002
  • 131
  • 1
  • 5
  • 12
0

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

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.

Peter B
  • 1
  • 1
-1

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

zx485
  • 28,498
  • 28
  • 50
  • 59
ssr
  • 1