Visual Studio无法打开解决方案文件 [英] Visual Studio won't open solution file

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

问题描述

我有一个VS项目(由其他人制作),当我尝试在Visual Studio 2008上打开它时,出现以下错误消息:

I have a VS project (made by someone else), and when I try to open it on Visual Studio 2008, I get the following error message:

所选文件是解决方案文件,但是是由该应用程序的较新版本创建的,无法打开"

"The selected file is a solution file, but was created by a newer version of this application and cannot be opened"

我本以为VS是向后兼容的.我有什么办法可以打开它吗?

I would have thought VS was backwards compatible. Is there any way I can open this?

推荐答案

VS是向后兼容的,是的-例如,您可以在VS 2008中打开VS 2005解决方案文件.它不是 forward 兼容的-大概是由VS 2010某个人创建的解决方案.根据评论,对于VS2010 SP1,您可以打开VS2012解决方案.我自己还没有验证.

VS is backwards compatible, yes - you can open a VS 2005 solution file in VS 2008, for example. It's not forward compatible though - presumably that solution has been created by someone with VS 2010. According to comments, with VS2010 SP1, you can open VS2012 solutions. I haven't verified this myself.

幸运的是,尽管解决方案文件不兼容,但我相信您应该能够在VS 2008中创建新的解决方案并添加使用2010创建的现有 project 文件,只要它们还没有没有使用任何VS2010特定的功能(无论是在项目结构中还是在代码本身中).如果代码以.NET 4为目标,则可能还需要调整项目文件以将其重新定位为.NET 3.5.

Fortunately, although the solution files aren't compatible, I believe you should be able to create a new solution in VS 2008 and add the existing project files created with 2010, so long as they haven't used any VS2010-specific features (either in the project structure or in the code itself). If the code targets .NET 4, you may need to adjust the project file to retarget it to .NET 3.5, too.

您可能会看到有关此警告(未知的工具版本或类似名称)-但它可能非常有用.我有多个项目,其中有针对VS2008和VS2010的单独的 solution 文件,但它们使用相同的 project 文件.

You may well see a warning about this (an unknown tools version, or something like that) - but it may very well work. I have a number of projects which have separate solution files for VS2008 and VS2010, but which use the same project files.

这篇关于Visual Studio无法打开解决方案文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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