[英]Can't open .NET 4.0.1 targeted project in Visual studio 2012
I have a legacy project which targets .net 4.0.1, and I can't change it to 4.5 because of its huge dependency. 我有一个针对.net 4.0.1的遗留项目,由于其巨大的依赖性,我无法将其更改为4.5。
I only have visual studio 2012 on my machine, now I am trying to open it. 我的机器上只有visual studio 2012,现在我正试图打开它。 Visual studio ask me to install 4.0.1, I follow to install it, and then it ask me to install visual studio 2010 sp1 first, I try to install sp1.
Visual Studio要求我安装4.0.1,我按照安装它,然后它要求我先安装visual studio 2010 sp1,我尝试安装sp1。 Of course it failed because i don't have visual studio 2010 installed.
当然它失败了,因为我没有安装visual studio 2010。
What should I do? 我该怎么办?
It's quite hard to track it down, but you can still download the Multi-Targeting Pack for Microsoft .NET Framework 4.0.1 (KB2495638) here: http://www.microsoft.com/en-gb/download/details.aspx?id=27757 . 跟踪它很难,但你仍然可以在这里下载适用于Microsoft .NET Framework 4.0.1的多目标包(KB2495638): http : //www.microsoft.com/en-gb/download/details.aspx ?id = 27757 。
This does work with VS2012 (unlike the one VS2012 tries to download for you). 这适用于VS2012(不像VS2012试图为您下载)。
I answer my own question: 我回答我自己的问题:
Manually change the TargetFrameworkVersion from 4.0.1 to 4.0 in the project .csproj file: 在项目.csproj文件中手动将TargetFrameworkVersion从4.0.1更改为4.0:
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>.
Just like Hans said we can't make visual studio 2012 work with 4.0.1. 就像汉斯所说,我们不能让visual studio 2012与4.0.1一起工作。 but 4.0.1 is very close to 4.0.
但4.0.1非常接近4.0。 I think as long as you can compile the project without errors 4.0 should be OK.
我认为只要你可以编译项目没有错误4.0应该没问题。 It works in my case.
它适用于我的情况。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.