vb.net 在不同版本的 Visual Studio 中打开项目和解决方案

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/14652669/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-17 12:08:49  来源:igfitidea点击:

Opening projects and solutions in different versions of Visual Studio

.netvb.netvisual-studio

提问by w0051977

Why can't you open a project or solution that was developed using one version of visual studio in another version of visual studio?

为什么不能在另一个版本的 Visual Studio 中打开使用一个版本的 Visual Studio 开发的项目或解决方案?

I understand that solutions contain projects and projects contain files e.g. aspx, vb etc. I also understand that one version of visual studio could default to targeting one version of .NET and the another could target a different version of .NET. Therefore I understand that it may be necessary to change code in the application if it now targets a different version of .NET as functions could be depreciated etc in a new version.

我了解解决方案包含项目,而项目包含文件,例如 aspx、vb 等。我也了解 Visual Studio 的一个版本可能默认针对一个版本的 .NET,而另一个版本可能针对不同版本的 .NET。因此,我了解如果应用程序现在面向不同版本的 .NET,则可能需要更改应用程序中的代码,因为新版本中的功能可能会折旧等。

I expected to find an answer to this online, but I have not. For example, I have looked at the following question: difference between visual studio 2008 and visual studio 2010.

我希望在网上找到这个问题的答案,但我没有。例如,我查看了以下问题:visual studio 2008 和visual studio 2010 之间的区别

回答by Brian S

In Visual Studio 2012, they addressed this issue (I agree, it can be a pain). In 2012, it will not modify the project file, so you can continue to open the project in 2010 after you've opened it in 2012. This allows teams with mixed Visual Studio versions (2010 & 2012) to continue working on the same projects.

在 Visual Studio 2012 中,他们解决了这个问题(我同意,这可能很痛苦)。在 2012 年,它不会修改项目文件,因此您可以在 2012 年打开项目后继续在 2010 年打开该项目。这允许具有混合 Visual Studio 版本(2010 和 2012)的团队继续处理相同的项目.

If you don't have VS 2012, and are still using 2010, then once you upgrade the project to the new version (say, from 2008 to 2010), you can no longer open the project in the older version, unfortunately.

如果您没有 VS 2012,并且仍在使用 2010,那么一旦您将项目升级到新版本(例如,从 2008 年到 2010 年),您将无法再在旧版本中打开该项目,很遗憾。

I'm not sure about your development environment, but if you don't already have it, there are free express versions of VS 2012 available: http://www.microsoft.com/visualstudio/eng/products/visual-studio-express-products.

我不确定您的开发环境,但如果您还没有,可以使用 VS 2012 的免费快速版本:http: //www.microsoft.com/visualstudio/eng/products/visual-studio-快递产品

回答by HackyStack

If you open an older project in vs 2010, it should prompt you to use a conversion wizard and you can convert to a vs 2010 project. If you are trying to open a newer project in an older version of vs, that is not going to be supported.

如果您在 vs 2010 中打开旧项目,它应该会提示您使用转换向导,您可以转换为 vs 2010 项目。如果您尝试在较旧版本的 vs 中打开较新的项目,则将不支持该项目。

回答by SubtleStu

It is possible to retrospectively open projects or solutions with different versions of VS by editing the version of the .sln or csproj file in notepad. There are some tools to download that do this automatically. But the problem is that the project will normally be built with a target framework not supported by the earlier version. I've done it in the past when I only had VS2005 and a contractor was using VS2010 but targetted at Framework V2.0. Not worth it in my opinion, I bought VS2010.

通过在记事本中编辑 .sln 或 csproj 文件的版本,可以使用不同版本的 VS 追溯打开项目或解决方案。有一些工具可以自动下载。但问题是项目通常会使用早期版本不支持的目标框架构建。过去,当我只有 VS2005 并且承包商使用 VS2010 但针对 Framework V2.0 时,我已经这样做了。在我看来不值得,我买了VS2010。