views:

329

answers:

4

Hi,

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>

A: 

NTFS Symbolic Link

Chris Ballance
Hmm, seems like a good idea. Thanks.
SDX2000
But wait wont this create two copies in the source control?
SDX2000
A: 

Try using the command line tools - tf.exe, and then setting up the bindings by using the File/Source Controls/Change Source Control... dialog once you've opened the unbound solution.

dhopton
A: 

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.

SDX2000
A: 

The "Add Solution To Source Control" wizard isn't really necessary if you are using TFS + you already have workspace mappings set up. (If you are using another source control system, or the solution folder is not mapped, this is not true.)

All you need to do is write bindings into the sln/proj files using the Change Source Control dialog. Unlike the full-blown wizard, the CSC dialog should not have any checks that stop you from binding >1 solution that live side by side.

Richard Berg