开发者

How can I open a Visual Studio 2008 project in Visual Studio 2010 and leave it in 2008 format?

Sometimes I do consultancy work for companies that are still using Visual Studio 2008, but I have 2010 installed.

I assumed (yes, assumption is the mother, father brother and sister of all f-ups!) that I would be able to open 2008 projects in 2010 without having to upgrade them. However, it appears that this is not the case?

Unfortunately, choosing to compile for .NET 3.5 wont solve this problem as the original developers will need to continue to develop开发者_C百科 the same projects in 2008


You can't leave a project in VS2008 format and there's no automatic way to downgrade a VS2010 project to a VS2008 project.

There are a number of differences to the files:

<Project ToolsVersion="3.5" ...

becomes:

<Project ToolsVersion="4.0" ...

The <ProductVersion> changes from 9.0.30729 to 8.0.30703 (though I am only using the 2010 Express editions at the moment so this might be different for the full version).

Alternatively you could upgrade the project on your machine and just copy back the source files. However, this would require more work if you added/removed any project files as this would have to be repeated on a machine running VS2008.


Unfortunately, I don't think there is a backward compatibility option for VS2010.

What I have been doing is upgrading the VS2008 project to 2010, and leaving backup copies of the project and solution files. I then rename all of the upgraded files to project_name_vs2010.* and rename the backup files back to the original name, since I'm the only developer using 2010. The downside is that any changes you make to the project or solution need to be redone inside of VS2008 (or manually edit the XML if you don't have a copy of 2008) before you push your changes. The positive is that all source files will work in both versions thanks to VS2010's multi-targeting. You'll definitely need to keep the compiler setting to 3.5 in order to keep all the source files compatible.


I faced this same issue with 2005 to 2008. If you aren't using anything that is not supported in the earlier version, such as .Net 4, then all you need to do is revert changes VS makes to the .proj file to then open it again in 2008. This is very annoying to have to do repeatedly but I think it is basically your only option.


You Can't.

However, you can have multiple solutions (one for 2010, one for 2008) which each reference the projects. The project files themselves don't have to change.

If you go this route, you have to make sure the project targets are no higher than .Net 3.5.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜