I am working on a C# project which must be built for more than one platform (.Net and CF.Net) and from past experiences I have found that the best approach that works for me is to have multiple parallel solutions present side by side in the same folder corresponding to each platform. All the code files, resources etc are shared by these projects/solutions and are common for all parallel projects.
Eg.
/SolutionFolder MySolution.sln MySolution_CE.sln /MyProject MyProject.csproj MyProject_CE.csproj
Now the problem is once I add MySolution.sln to source control I cannot add MySolution_CE.sln. It says something on the lines of ‘Cannot add two solutions on the same path’.
<edit>
To answer ctake’s question, I am trying to add the solution from VS2008 by right clicking on the solution and saying ‘Add to source control’.
Also I forgot to mention that I added the solutions manually anyway but VS2008 does not bind to this solution i.e. the files cannot be checked in/out from these ‘forced’ solutions from within VS2008.
</edit>
Ok, here is a possible work around to this problem. Needless to say it’s inelegant but it works nevertheless without going through the pains of writing a custom source control addin for VS2008…
Steps:
1. Open MySolution.sln in visual studio and then say add to source control then check in the first version.
2. Goto File->Source Control->Change Source control and unbind the solution from the source control.
3. Close the MySolution.sln
4. Open MySolution_CE.sln
5. Goto File->Source Control->Change Source control and bind the solution from the source control by clicking on Bind VS2008 should pick up the correct bindings automatically if the dir structure mentioned in the question was adhered to.
6. Add CE specific files to the solutions/projects and do an initial checkin.
7. Repeat this bind/unbind operation each time you wish to do a checkin from the other solution (I know this is a pain).
Hope this helps.