我们开始使用VS 2010和非常满意的,所以我们转变我们的项目为2010解决方案(还是.NET 3.5),并继续我们的发展在2010年。不过,我们最近得到了很多的错误,并希望回到2008年解决方案文件已经改变(增加到处都是新的项目和文件),但一切都还在.NET 3.5。我想知道是否存在要迁移回2008的简单方法。

有帮助吗?

解决方案

Depending on if they kept the solution file structure similar between 2008 and 2010, you just need to create an empty solution file in 2008 and look at the top identifier line in it, and copy it into the other solution file.

I however doubt they kept it the same since they were integrating a number of features into solution files.

You would be better off to create a new blank solution in 2008 and use "Add existing project" to reimport them. As long as you dont have any custom "solution" wide references this will work (no solution folders, server setups, etc).

It is probably the fastest and most direct route.

其他提示

I had success changing the first 2 lines from:

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010

to

Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008

Assuming that your solution is under source control and the migration from VS 2008 to VS 2010 was the only change in that checkin, just compare the two version and see what's changed.

Then change the lines affected back to the VS 2008 version and you should be good to go.

There's no automatic process as Microsoft see this as a one way operation.

You can manually edit .sln file in text editor. There is field named version, or like that, just change it from 10 to 9.

This question

How does one convert a Visual Studio .NET 2008 solution to Visual Studio .NET 2005?

might also be applicable for converting from 2010 back to 2008.

You can use "Project Converter": http://www.emmet-gray.com/Articles/ProjectConverter.htm

I have just found it. I am going to test it right now! :-)

Please try the following (find first line and replace to second line to convert 2010 solution to 2008):

TargetFrameworkMoniker = ".NETFramework,Version=v2.0"
TargetFramework = "3.5"

# Visual Studio 10
# Visual Studio 2008

Microsoft Visual Studio Solution File, Format Version 11.00
Microsoft Visual Studio Solution File, Format Version 10.00

<Project ToolsVersion="4.0"
<Project ToolsVersion="3.5"

<ProductVersion>10.0.20506</ProductVersion>
<ProductVersion>9.0.30729</ProductVersion>

\VisualStudio\v10.0\
\VisualStudio\v9.0\

<Import Project="$(MSBuildToolsPath)\Workflow.Targets" />
<Import Project="$(MSBuildExtensionsPath)\Microsoft\Windows Workflow Foundation\v3.5\Workflow.Targets" />

This worked on my solutions, you can try to see if it fit to your cases.

as maZZoo tells, you have to replace those lines in .sln, but if you check you Output panel you may have an alert of using ToolsVersion="4.0", you have to replace that in the .csproj to:

<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top