Cannot open target .NET 4.0.1 project in Visual Studio 2012

I have an inherited project that targets .net 4.0.1, and I cannot change it to 4.5 because of its huge dependency.

I have only visual studio 2012 on my machine, now I'm trying to open it. Visual studio will ask me to install 4.0.1, I follow to install it, and then ask me to install visual studio 2010 sp1 first, I'm trying to install sp1. Of course, this failed because I do not have a visual studio 2010.

What should I do?

+4
source share
2 answers

It's hard to track it, but you can still download the Multi-Targeting package for Microsoft.NET Framework 4.0.1 (KB2495638) here: http://www.microsoft.com/en-gb/download/details.aspx?id=27757 .

This works with VS2012 (unlike the one that VS2012 is trying to download for you).

+3
source

I answer my question:

Manually change the TargetFrameworkVersion from 4.0.1 to 4.0 in the .csproj project file:

<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>. 

Like Hans, we cannot make visual studio 2012 work with 4.0.1. but 4.0.1 is very close to 4.0. I think that as long as you can compile the project without 4.0 errors, everything should be fine. This works in my case.

+1
source

Source: https://habr.com/ru/post/1491932/


All Articles