Adding a solution or project to Source Control from IDE

A collection of information about Vault, including solutions to common problems.

Moderator: SourceGear

Post Reply
dan
Posts: 2448
Joined: Wed Dec 17, 2003 5:03 pm
Location: SourceGear
Contact:

Adding a solution or project to Source Control from IDE

Post by dan » Tue Apr 13, 2004 10:09 am

This post gives an overview of adding a Visual Studio solution/project to Vault from the IDE, so that source control operations can be accomplished on source files from within the IDE. If the project is a Visual Studio.Net Web Project, also see http://support.sourcegear.com/viewtopic.php?t=222, since they have additional requirements associated with them.

NOTE: In Vault 4.x and later, these steps apply to the Classic Client or VS 2003-style integration.


The most important thing to do before adding a solution to Vault from the IDE is to ensure that all files and folders that are contained within the solution or project being added are within your working folder hierarchy.

For example, if your solution is located on c:\projects\Solution1, then all of the projects, folders, and files that are used within the solution should be located somewhere at or under c:\projects\Solution1. If they are not, Visual Studio will find the common root folder of all your files, and create additional, duplicate paths in Vault when adding the solution.


Use the following steps to add a solution to Vault from the Visual Studio .Net IDE (note: steps will vary with other IDEs):


-- Backup your working folder. Once a solution or project is added to source control, Visual Studio modifies the project and solution files, and if something goes wrong, the state of those files might be incorrect.

-- Invoke Visual Studio, load/open the solution or project

-- Select the solution to add, and either right click and select “Add Solution to Source Control”, or select File->Source Control->Add Solution to Source Control”.
The Vault login dialog will be displayed. If the Vault login is not displayed, you may not have selected Vault to be your source control provider. Go to the Vault GUI Client, Tools->Options, and verify that “Make Vault your default SCC Provider” is checked. The login name you provide here will be the user that is reported in history as having added the solution/project and all the files.

-- Provide connection information to the login dialog to connect to the server you want the solution added to. Note that you may also create a login profile, which would allow you to automatically connect to a repository on subsequent login attempts.

-- If you did not create a profile that automatically connects to a repository, a Choose Repository dialog will be displayed next. Choose the repository within the Vault server you want the solution to be added to.

-- The “Add to Vault Folder” dialog will be displayed, which allows you to place the solution into the folder of your choice within the Vault repository you previously selected. <b>Note carefully whether the project, working folder, and location within Vault are correct before continuing</b>. You may change the project name, which affects the topmost folder the solution or project will be placed (note that if you change the project name, the path name in the repository also changes). Also verify that the working folder reported by Visual Studio (in the “Add project from working folder” field) is correct. If not all of your files are within your intended working folder, this value will be wrong as reported by Visual Studio, and a lot of duplicate folders will be created within Vault as a result.

-- If you want to create a new folder in Vault to put the project under, you will have to create that folder in the Vault GUI client, and then hit the refresh button in this dialog.

-- After choosing the location in Vault, press OK. Files and projects will be added to Vault at this time. Check the Output pane in Visual Studio to see the progress of the operation.

-- After the add, check the Vault GUI client and verify that the solution/project structure reflects what you think it should have. If there is a problem, you can delete the project just added, and re-add with the backup created in step 1.


In order for other users to use this solution/project, they must initially do an “Open From Source Control” from the IDE. Doing a Get Latest from the Vault GUI client will not create the bindings required by the IDE. The Open From Source Control will do an initial Get Latest, and will create the correct bindings. After that, you can do a Get Latest from any Vault client, and it will be reflected correctly in the IDE client.

Post Reply