How To SSAFE - Reconnect a Project to Source Control in Visual Studio .NET (305106)



The information in this article applies to:

  • Microsoft Visual SourceSafe 6.0c, when used with:
    • Microsoft Visual Studio .NET (2002), Professional Edition
    • Microsoft Visual Studio .NET (2002), Enterprise Architect Edition
    • Microsoft Visual Studio .NET (2002), Enterprise Developer Edition

This article was previously published under Q305106

SUMMARY

In Visual Studio .NET, it is much easier to disconnect a project from and reconnect a project to source code control than in previous versions of the project. With Visual Studio .NET, you can perform these functions from within the integrated development environment (IDE) by "binding" your project to Source Control.

MORE INFORMATION

An example scenario in which you might use this ability would be if you had added your project to a Microsoft Visual SourceSafe database through the Visual SourceSafe Explorer instead of through the Visual Studio IDE. The project would not have the files or entries required to tell Visual Studio that the project was bound to a Visual SourceSafe database. By binding to the Visual SourceSafe database, you create the files and entries that must be created, thereby enabling the integration.

For an existing Visual SourceSafe project:
  1. Using the SourceSafe Explorer, set a working directory for $/<project path> to C:\<folder name>.
  2. In the Visual SourceSafe Explorer, do a recursive get to the folder that you just created on your local computer:
    1. Select the project you would like to reconnect to source control.
    2. Right-click the selected file, and then click Get Latest Version from the context menu.
    3. Select the Recursive, Make Writable, and Build Tree check boxes.
    4. Type the path to the folder that you created on your local computer in the To: box.
    5. Click Ok.
  3. Give read/write permissions to all *.user files found on C:\<folder name>. This will allow you to check them in later.
  4. Using Visual Studio .NET, open the solution from C:\<folder name>.
  5. Open the Source Control dialog box: From the File menu, point to Source Control, and then click Change Source Control.
  6. Select the file that you want to reconnect to the Visual SourceSafe database, and then click bind. A graphical user interface representation of your project tree will appear and you will be prompted to choose the project in Visual SourceSafe that your local project was initially downloaded from. You will also notice that your working directory path is listed in the "working folder" window. Click OK.
  7. The Server Binding field will now be populated with the server path you are connected to and the Status window will either show "Valid" or "Invalid". If it says "Valid," continue by repeating step 6 for each file in the Change Source Control List. If the Status window states that your new binding is "Invalid," you can try connecting to your project one level lower or higher in the Visual SourceSafe project explorer.

    NOTE: You may only need to highlight some files and click the bind button to connect them to the Visual SourceSafe Database.
  8. When you have finished binding all of your projects to the Visual SourceSafe database, click Ok.
  9. Next, you will be asked if you would like to check out your project from the database. Leave the default items selected and click Check Out. You can also add any comments here that you would like added to your files.

    Your files will then be under source control within the Visual SourceSafe database. There will be a lock or check mark/exclamation point icon to indicate the current status of the files you have under source control (checked out vs. not checked out).
  10. Check in the changes to enable integrated source control services for other team members who are working on your project.

Modification Type:MinorLast Reviewed:7/13/2004
Keywords:kbhowto kbSrcControl KB305106