Put a project or solution under P4 Server source control

P4 for Visual Studio requires that your work be included in a project or solution file.

Make sure that your project or solution and all files included in it reside in the workspace (your client directory) being used by your P4 Server connection.

The way to put the project or solution under P4 Server source control depends on your configuration:

For more configuration information, see Set P4 for Visual Studio preferences.

Option 1: Existing project or solution with P4 for Visual Studio as active source control provider

  1. In the Solution Explorer, select the project or solution that should be placed under source control.
  2. Follow the procedure described in Add files to the depot.

Option 2: New project or solution with P4 for Visual Studio as active source control provider

  1. In the New Project dialog, if P4 for Visual Studio is not set to automatically put files under P4 Server source control, select the Add to source control using P4 for Visual Studio check box under the Browse button.
  2. Click OK.

    If you are offline, the Open Connection dialog opens; continue with step 3. Otherwise, continue with step 4.

  3. In the Open Connection dialog, enter your P4 Server connection settings and click OK.

    P4 for Visual Studio opens the project or solution and any related files for add.

  4. Continue with submitting the changelist.

Option 3: New project or solution without P4 for Visual Studio as active source control provider

  1. In the status bar, at the bottom right of the window, click Publish (Visual Studio 2015) or Add to Source Control (Visual Studio 2017), and then select P4 for Visual Studio - P4 for Visual Studio.

    Note that this option is not available in Visual Studio 2013.

  2. In the Open Connection dialog, enter your P4 Server connection settings and click OK.

    The files in the Solution Explorer now display a red plus sign to indicate that they are marked for add.

    The Add to Source Control option in the bottom right of the window changes to 1 Pending Change or X Pending Changes (if you have other pending changelists in addition to the default changelist).

  3. Continue with submitting the changelist.