Perforce and Visual Studio .NET
"Good To Know" details regarding Source Control component of Visual Studio .NET.
This article talks about specifics you need to know when using the P4SCC plugin with Visual Studio .NET.
The following versions of Visual Studio support version control:
- The Enterprise and Professional editions of .NET 2002 and .NET 2003
- All editions of Microsoft Visual Studio 2005 (8.0), except the Express Version
- Microsoft Visual Studio 2008 (9.0)
- Microsoft Visual Studio 2010
Any version not listed does not support version control.
Which version of the Perforce SCC plug-in to use
Below is the list of the most common types of Visual Studio files:
|.csproj||Visual C# project|
|.dmp||Crash Dump project|
|.dsw||Visual Studio Workspace|
|.etp||Enterprise Template project|
|.hwproj||Microsoft Help project|
|.mdmp||Crash Dump project|
|.mdp||Project Converter (VC 4.x)|
|.vbproj||Visual Basic project|
|.vcproj||Visual C/C++ project|
|.vdp||Setup and Deployment project|
|.vdproj||Setup and Deployment project|
|.vsmacros||Binary based macro project|
|.vsmproj||Unicode based macro project|
|.opt||Source Code Control related|
|.suo||Source Code Control related|
|.vssscc||Source Code Control related|
|.vcproj.vspscc||Source Code Control related|
|.csproj.vspscc||Source Code Control related|
|MSSCCPRJ.SCC||Source Code Control related. Perforce is responsible for the content of this file. This file must never be added to Perforce.|
Good to know ...
Do not put the .suo files (user preferences) in Perforce. .NET will automatically add .vsscc, vssscc and .vspscc files to Perforce if needed. In general, leave it up to your IDE whether or not to check certain source control specific files into Perforce.
Always add Visual Studio files to Perforce from within the Visual Studio IDE. If you need to Bind the files to Perforce from within Visual Studio manually:
- Load the project into .NET
- Choose File>Source Control>Change Source Control.
- Highlight the solution and project files.
- Choose Bind.
- Click OK.
After you have completed these steps, you should be able to check the files in and out. You can also use the above method if you need to re-connect your .NET Project with Perforce.
- In Perforce, add is a two-step process, while Visual Studio expects a single "auto-add".
To add a file to an existing solution in Visual Studio .NET:
- To open a file for add, choose Add New|Existing Item.
- To submit a file, select the file and choose Check In Now.
To see which files are open for add, choose Show Pending Checkins.
- Always Use Visual Studio .NET for Source Control Operations
- Use a Single Solution Model whenever possible. The Single Solution Model uses one .sln file as a container for all of the projects defined by your application
- Use a Consistent Folder Structure for solutions and projects. Ideally, keep solution files in the top directory and all of the projects in subdirectories.
To map a project from another machine/location after your initial sync, choose File->Source Control->Open from Source Control. This command updates the files with the new user and workspace attributes during an implicit bind. The first time you do this, you must enter the full path to the solution file.
For further information on the Perforce SCC Plug-In, see:Perforce-User archives