简体   繁体   English

无法在Visual Studio 2012中打开.NET 4.0.1目标项目

[英]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.

相关问题 我可以在版本4.6.2的Visual Studio项目中使用针对4.5.1 .net框架的库吗? - Can I use a library which is targeted to 4.5.1 .net framework in a visual studio project of version 4.6.2 项目的目标 .NET 框架取决于 Visual Studio 版本? - Targeted .NET framework for the project depends on Visual Studio version? 无法在Visual Studio 2012 Ultimate上安装SSH.NET - Can't install SSH.NET on Visual Studio 2012 Ultimate 无法在Visual Studio 2019中打开Service Fabric项目 - Can't open Service Fabric project in Visual Studio 2019 什么是.xproj文件以及如何在Visual Studio 2012中打开此项目类型? - What is .xproj file and how to open this project type in Visual Studio 2012? 无法在Visual Studio 2012 Ultimate SP1 x64中创建或打开网站 - Can't Create Or Open Web Sites in Visual Studio 2012 Ultimate SP1 x64 无法在 Visual Studio 项目属性中选择 .NET Framework 2.0 - Can't select .NET Framework 2.0 in Visual Studio Project properties 无法在Visual Studio项目属性中选择.NET Framework 4.6.1 - Can't select .NET Framework 4.6.1 in Visual Studio Project properties 无法在Visual Studio 2012中将WSDL Web引用添加到.NET项目 - Cannot Add WSDL Web Reference to .NET Project in Visual Studio 2012 Visual Studio 2012 - 在 .NET 4.5 框架中找不到 System.Transactions 程序集 - Visual Studio 2012 - Can't find System.Transactions assembly in .NET 4.5 framework
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM