15
votes

I have installed Visual Studio 2012 Professional on my machine. I don't have Visual Studio 2010 installed, but I want to keep developing my applications using .NET Framework 4, but I don't have this option on my Visual Studio 2012. Look at the image:

Enter image description here

I don't know what can I do to fix this problem, because I click on "More Frameworks..." link and try to install the Multi-Targeting for .NET 4.0.3 (installed on my machine), but it does not work. It says that this version of framework is still installed. What can I do to fix this problem?

Obs: I have lots of projects in C# and VB.NET with .NET 4.0, and I need to keep these projects with new projects on .NET 4.0.

4
I believe this may be a symptom of .Net 4.5 being an in-place upgrade... I believe if you target .Net 4.5 and don't use any 4.5 only features, it should run in .Net 4.0 though - Earlz
it says that this version of framework is still installed. Surely it gives a better error message than that? - Hans Passant
Have you installed the .net 4 framework ? What does C:\Windows\Microsoft.NET\Framework have in it ? - Micah Armantrout
Micah, I have some folder at the framewor folder: v2.0.50727, v3.0, v3.5 and v4.0.30319. When I try to install framework 4, it says that I have a newer version of .net framework. - Felipe Oriani

4 Answers

4
votes

I solved the problem doing these tasks:

  • Uninstall the Visual Studio 2012
  • Uninstall any reference for the .NET Framework 4.0 or 4.5
  • Clean the register with a tool like Glary Utilities and restart the computer
  • Install the .NET Framework 4.0 and install Microsoft Multi-Targeting for .NET Framework 4.
  • Install Visual Studio 2012 again
2
votes

You fixed your problem, but it's likely that .NET Framework 4 Targeting Pack (not to be confused with the .NET Framework itself) failed to install for some reason. Did you get a warning at the end of the Visual Studio installation? Either way, in the future, a repair install of Visual Studio 2012 should have fixed the problem (Add or Remove Programs -> Microsoft Visual Studio [Edition] 2012 -> Change -> Repair).

0
votes

I think that your issue is probably some mishap with the installation of .NET Framework. I installed Visual Studio 2012 Beta and have all kind of troubles with compatibility between framework versions. The only remedy was reinstalling Visual Studio, including .NET Framework.

Check out How to: Target a Version of the .NET Framework (MSDN).

0
votes

After creating new a project, go to its properties (select your project in Solution Explorer then right click and select properties) and select the target framework!