Click here to Skip to main content
15,885,278 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to create a new MS project file with different versions (2003,2007,2010) of our choice at runtime and add task to that file.
Posted
Updated 5-May-11 18:10pm
v2

1 solution

It's hard to answer in short. The idea is: the format of XML project files are different for different Visual Studio versions (you made two mistakes: there are v. 2003, 2005, 2008 and 2010; better do not consider anything prior to 2005 (Framework v.2.0)). With VS 2008 and 2010, you can simply specify different target platform and use it as a build parameter. The problem is that the .NET code for the different versions of Framework should be a bit different.

You can create a master project using MSBuild API (optionally, for custom tasks) and the general syntax of the project. It can be uses as a "super-solution" building other solution for different versions. If you right the master project file manually, it can be much more flexible than the one created by Visual Studio. You don't need Visual Studio for build. You only need the Framework of compatible version and the versions of MSBuild bundled with it.

I really cannot give more detail here as it would probably take a really big article to explain all the detail. However, I've done all this; and I never used any help or any documentation beyond MSDN. So, you can do the same. Start here:
http://msdn.microsoft.com/en-us/library/0k6kkbsd.aspx[^].

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900