visual-studio VS2010 可以将项目转换回 VS2008 吗?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2227679/
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
VS2010 possible to convert projects back to VS2008?
提问by JL.
As you all know the VS 2010 RC is out for MSDN subcribers.
众所周知,VS 2010 RC 面向 MSDN 订阅者推出。
Unfortunately I guess I have the same problem as some of you, in that the company I work for wants to continue keeping our projects on VS 2008.
不幸的是,我想我和你们中的一些人有同样的问题,因对我来说有效的公司希望继续在 VS 2008 上保留我们的项目。
I would like to know if its possible for me to work with VS 21010, then later convert my projects back to VS2008?
我想知道我是否可以使用 VS 21010,然后将我的项目转换回 VS2008?
I intend to use v3 of the framework for this particular project.
我打算在这个特定项目中使用框架的 v3。
Thanks in advance..
提前致谢..
采纳答案by Anton K
It depends on a kind of project you use. It's absolutely impossible to convert VC++ back from 2010 since they have completely different format and no tools to rollback. However, C# and VB.NET still use the same msbuild project format as in VS2008, which will be changed in the next VS version (Dev11) and so all you need to manage C# or VB.NET project version is the ToolsVersion attribute of the Project element.
这取决于您使用的项目类型。从 2010 年开始转换 VC++ 是绝对不可能的,因为它们具有完全不同的格式并且没有回滚工具。但是,C# 和 VB.NET 仍然使用与 VS2008 相同的 msbuild 项目格式,这将在下一个 VS 版本(Dev11)中更改,因此您只需管理 C# 或 VB.NET 项目版本的 ToolsVersion 属性即可项目元素。
VS 2008 C# project version:
VS 2008 C#项目版本:
<Project DefaultTargets="Build" ToolsVersion="3.5" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
VS 2010 C# project version:
VS 2010 C#项目版本:
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
One of the approaches is to use both project systems simultaneously as our team does. Another one is to use targeting for different .NET frameworks in VS2010 projects. V2010 supports all previous .NET frameworks as targets farmeworks till .NET 2.0
其中一种方法是像我们的团队一样同时使用两个项目系统。另一种方法是在 VS2010 项目中针对不同的 .NET 框架使用目标。V2010 支持所有以前的 .NET 框架作为目标 Farmeworks 直到 .NET 2.0
Finally, don't be upset by using VS2008 as it's much faster and reliable.
最后,不要因为使用 VS2008 而感到沮丧,因为它更快更可靠。
回答by sebastiaan
我刚刚创建了一个小批处理文件,可以随意在 VS2008 和 VS2010(反之亦然)之间进行转换。
It rewrites the strings found at http://blogs.msdn.com/rextang/archive/2009/07/06/9819189.aspxbetween both versions in an automated fashion.
它以自动方式在两个版本之间重写在http://blogs.msdn.com/rextang/archive/2009/07/06/9819189.aspx 上找到的字符串。
回答by xgalaxy
I think it would be easier to keep the work projects in VS 2k8 and just convert up to VS 2k10 on your end. Of course this means you would have to manually edit back in any changes you make to the solution or project files but you would have to do that either way you go.
我认为将工作项目保留在 VS 2k8 中并最终转换为 VS 2k10 会更容易。当然,这意味着您必须手动编辑对解决方案或项目文件所做的任何更改,但无论如何您都必须这样做。
Perhaps it would be best if your company invested in utilities (such as SCons or CMake) that are able to generate solution/project files for as many IDE's as you need given a set of metadata so that the companies engineers can use whatever environment they are most comfortable with.
如果您的公司投资于能够为您需要的尽可能多的 IDE 生成解决方案/项目文件的实用程序(例如 SCons 或 CMake),那么最好给定一组元数据,以便公司工程师可以使用任何环境最舒服。
While I think there is an argument to be made for having everyone work in whatever IDE suite they are most comfortable with ultimately productivity will be the deciding factor. If engineer's are spending too much time converting project files back and forth between IDE's, well then having a standardized suite of software is probably the wise choice.
虽然我认为有一个论点是让每个人都在他们最熟悉的任何 IDE 套件中工作,但最终生产力将是决定性因素。如果工程师花费太多时间在 IDE 之间来回转换项目文件,那么拥有一套标准化的软件可能是明智的选择。
回答by daszarrin
to convert visual studio 2010 solution file (.sln) to visual studio 2008 solution file (.sln) simply follow these steps:
要将 Visual Studio 2010 解决方案文件 (.sln) 转换为 Visual Studio 2008 解决方案文件 (.sln),只需按照以下步骤操作:
- in .sln file replace "Format Version 11.00" to "Format Version 10.00"
- in .sln file replace "# Visual Studio 2010" to "# Visual Studio 2008"
- in .csproj replace "ToolsVersion=''4.0''" to "ToolsVersion=''3.5''"
- in .csproj replace "v10.0" to "v9.0"
- 在 .sln 文件中将“格式版本 11.00”替换为“格式版本 10.00”
- 在 .sln 文件中将“# Visual Studio 2010”替换为“#Visual Studio 2008”
- 在 .csproj 中将“ToolsVersion=''4.0''”替换为“ToolsVersion=''3.5''”
- 在 .csproj 中将“v10.0”替换为“v9.0”

