Monday, April 03, 2006

How to create and add to SC solution with controlled projects

The idea is to have several Visual Studio solutions under source control - one solution containing all projects for release purposes and smaller modular solutions for development of different modules.

I have proceeded to achieve the goal as following:

1. Created new solution and added to it several projects
2. Added the solution with all projects to SC (using "Add solution to SC" menu)
3. Closed the solution
4. Created new empty workspace
5. Created new blank solution
6. Added existing source-controlled project to the solution using "Add project from SC" menu; mapped project path to be subfolder of the solution folder. At that stage I have modular solution with single project and I would like to add that solution to SC - and the things started going wrong
7. Tried to add solution to SC using "Add solution to SC" menu. Solution is not added and error messages are displayed to the effect that there are no pending check ins on solution files.

As was explained in the following discussion, to avoid these errors and reach the goal, the scenario must be somewhat revised. So instead do the following:

4. Create a new empty workspace, don't add any mappings.
5. Create a new blank solution and check the "Add solution to Source Control" box. It will prompt you for a location in SC to store the solution. If you created the new solution in an unmapped folder, there will also be a dropdown to select the workspace.
6. Bring up the "Add project from SC" dialog. After you choose the project (and location on disk if necessary), it should appear in Solution Explorer as already bound (with padlock as status indication).
7. Checkin the solution. Since the project is already bound, you only have to checkin the two solution files.

No comments: