反向相容性問題

C# “Backward” Convert Visual Studio 2010 .csproj project to 2008?

I have a .NET 3.5 project in VS 2010. Is there a way to convert the VS 2010 .csproj file format to a VS 2008 .csproj file format without making a new project using VS 2008 and re-adding everything? A tool or utility? Visual Studio, as far as I know, only provides an upgrade path.

I'm distributing the app source to users of VS 2008.

Answer 1

The project files are exactly the same between 2008 and 2010 (excluding the new types added in 2010). Only the solution file varies, so you can create a solution file in 2008 and "Add Existing Project"

However if you're targetting .NET 4.0 then you're going to have problems, as thinks change in the project file. http://www.emmet-gray.com/Articles/ProjectConverter.htm has the details of those changes, and more importantly, a program to do it all for you.

Answer 2

You don't need to create a new project. I think changing the target framework in the project properties from 4 to 3.5 should do the trick. Maybe you should also open the .csproj file in a text editor and change the version of visual studio from 10 to 9 (but I'm not sure there is such a setting there, maybe it only exists on solutions).

Answer 3

Project files are backwardly compatible. In the past I have worked on projects in VS2010 when the bulk of other developers are working in VS2008.

Essentially I have created a new .sln file alongside the .2008.sln file.

The main area where you will hit pain is if the project type is not supported in VS2008. i.e. MVC3 is not supported with VS2008 so those projects would not load.

http://stackoverflow.com/questions/5453696/c-sharp...

陳鍾誠 (2011年12月20日),(網頁標題) 反向相容性問題,(網站標題) 免費電子書:C# 程式設計,2011年12月20日,取自 http://cs0.wikidot.com/backwardimport ,網頁修改第 0 版。

arrow
arrow

    Johnson峰 發表在 痞客邦 留言(0) 人氣()