无需升级即可在 Visual Studio 2013 中打开 Visual Studio 2008 解决方案 [英] Open Visual Studio 2008 Solution in Visual Studio 2013 without Upgrading

查看:95
本文介绍了无需升级即可在 Visual Studio 2013 中打开 Visual Studio 2008 解决方案的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

简而言之:我需要在 Visual Studio 2013 中打开最初在 Visual Studio 2008(版本 9)中构建的应用程序而不升级项目,因为在我将其检回源代码时,整个项目架构必须保持不变控制.

详细信息:我需要在 Visual Studio 2013 中打开一个 Visual Studio 解决方案 (.sln).有问题的解决方案最初是在 Visual Studio 2008 中开发的,所以当我尝试在 Visual Studio 2013 中打开所述解决方案时,我会看到一个提示,其中包含选中的解决方案中的项目,并显示以下消息:

Details: I need to open a Visual Studio solution (.sln) inside Visual Studio 2013. The solution in question was originally developed in Visual Studio 2008, so when I try to open said solution in Visual Studio 2013, I am shown a prompt with the projects within the solution checkmarked, with the message:

  • 这些项目要么受支持,要么需要影响修改的项目行为才能在此版本的 Visual Studio 中打开.未显示的项目不需要更改或将自动修改以不影响行为.Visual Studio 将自动对以下项目进行功能更改以打开它们.您将无法在最初创建这些项目的 Visual Studio 版本中打开这些项目.*

我的修复尝试只是升级解决方案并希望获得最好的结果.这是成功的,但在构建并尝试运行主项目后,我看到以下构建错误:

My attempt at a fix was to just upgrade the solution and hope for the best. This is successful, but after building and attempting to run the main project, I see the following build error:

  • 类型Microsoft.Web.Services3.WebServicesClientProtocol"是在未引用的程序集中定义的.您必须添加对程序集Microsoft.Web.Services3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"的引用.*

然后我尝试注释掉对该程序集的引用添加缺少的引用.好的,然后我重建了解决方案并尝试运行.相同的错误,但针对不同的程序集.重复修复,不同组件的相同错误.这种模式一直持续下去,此时我意识到无论如何这是不可接受的,因为当我对这个解决方案进行更改时,我需要将其重新检查到源代码管理中.别人打开的时候,可能是在VS2008中打开的,所以这个升级"的版本与企业使用的版本不一致.我需要在 VS 2013 中打开最初在 VS2008 中构建的解决方案(无法解决这个问题,需要是 VS2013).如果有帮助,我将使用 64 位 Visual Studio 2013 Ultimate.

I then tried both commenting out the references to this assembly and adding in the missing reference. Okay, so then I rebuilt the solution and attempted to run. Same error, but for a different assembly. Repeat fix, same error for different assembly. This pattern continues and continues, and at this point I realize this is unacceptable anyway, because when I make a change to this solution, I need to check it back into source control. When others open it, they may be opening it in VS2008, and therefore this "upgraded" version is inconsistent with the version the business uses. I need to open the solution originally build in VS2008 in VS 2013 (can't work around this, needs to be VS2013). If it helps, I'm using 64 bit Visual Studio 2013 Ultimate.

任何帮助或指导将不胜感激!

Any help or guidance will be greatly appreciated!

推荐答案

正如一些评论者已经指出的那样,这是不可能的.往返(,在较新版本的 Visual Studio 中打开和操作由较旧版本的 Visual Studio 创建的项目文件)在 Visual Studio 11 之前不受支持.在更高版本的 Visual Studio 中打开 Visual Studio 2008 项目/解决方案的唯一方法是对其进行转换.

As several of the commenters have already helpfully pointed out, this is not possible. Round-tripping (i.e., opening and manipulating project files created by an older version of Visual Studio in a newer version of Visual Studio) was not supported until Visual Studio 11. The only way to open a Visual Studio 2008 project/solution in a later version of Visual Studio will be to convert it.

就与以前版本的互操作性而言,您有两种选择:

As far as interoperability with previous versions is concerned, you have two options:

  1. 在本地更新项目(使用提供的迁移向导),对项目文件进行任何必要的更改以使其构建,然后编辑代码文件.一旦您对您的编辑感到满意,请提交修改后的源文件,不要提交项目基础结构文件.坚持使用 VS 2008 的其他开发人员不会注意到任何区别.

  1. Update the project locally (using the migration wizard provided), make any changes to the project file necessary to get it to build, and then edit the code files. Once you're satisfied with your edits, commit only the modified source files, not the project infrastructure files. Your fellow developers, stuck on VS 2008, won't notice any difference.

在本地更新项目(使用提供的迁移向导),对项目文件进行任何必要的更改以使其构建,然后重命名项目文件(例如,通过在其后附加 -vs2013 后缀).将此提交到您的代码存储库.现在,您的根目录中有两个项目文件,您的团队使用的每个 Visual Studio 版本都有一个.从这里开始,您只需打开与您安装的 VS 版本对应的项目文件即可.

Update the project locally (using the migration wizard provided), make any changes to the project file necessary to get it to build, and then rename the project file (e.g., by appending a -vs2013 suffix to it). Commit this to your code repository. You will now have two project files in your root directory, one for each version of Visual Studio that your team works with. From here on, you just open the project file corresponding to the version of VS that you have installed.

我在去年的大部分时间里都使用了方法 #1,我花了大部分时间在台式机上的 VS 2010 中开发 C++ 应用程序,但也想在运行 VS 2013 的笔记本上开发它.当然,就我而言,从源代码管理中提取后,自动转换升级我的项目文件需要很短的时间.此后我无需进行任何调整即可构建项目.听起来您的情况有所不同,因此选项 #2 可能是更好的选择.

I used approach #1 for a good part of last year, where I spent most of my time developing a C++ application in VS 2010 on a desktop machine, but also wanted to work on it on my notebook running VS 2013. Of course, in my case, it took a trivial amount of time for the automatic conversion to upgrade my project file after pulling from source control. I didn't have to do any tweaking thereafter to get the project to build. It sounds like your case is different, so option #2 might be a better choice.

这篇关于无需升级即可在 Visual Studio 2013 中打开 Visual Studio 2008 解决方案的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆