Adding Solutions, Projects, and Files to Source Control

You can add solutions, projects, and files to source control.

Guidelines and considerations:

- You can add solutions that contain website projects to source control.

- When adding a project or file to an existing solution or project that is already under source control you are prompted to check out the relevant files if pessimistic check-out is enabled. If pessimistic check-out is disabled then when you save the solution or project you will be prompted to overwrite the existing read-only versions.

- When adding a new Visual Studio project to an existing solution that is already under source control, exit Visual Studio and reopen the solution from source control. This ensures that the source control bindings and Dimensions CM metadata are set correctly.

- The Dimensions CM item type PROJECT is reserved for project marker files. Any other files with the PROJECT item type are ignored.

- Controlled solutions cannot span multiple Dimensions CM projects or streams.

- Solutions must be contained in their own folder.

- Solutions and projects should be in separate folders.

- We recommend to keep only one solution in a folder.

- For multiple solutions, we recommend a parallel structure that allows multiple solutions to be contained in separate folders. In this layout, the solutions and projects on disk are peers rather than parents/children.

- For multiple solutions that need to share projects, use a parallel structure. In this case, you keep project and solution folders separate, unlike in a parent/child layout.

- You can add uncontrolled solutions with controlled projects to source control, provided that they are all in the same Dimensions CM project/stream, and that their repository path is the same as the path that would have resulted if the solution and projects were added in one operation. This is validated prior to attempting the operation, and you are notified if the paths are different.

  After adding the solution to source control, reopen it from source control. This is necessary as the Dimensions CM metadata for projects in the newly added solution will not match metadata for a solution controlled in one operation. When reopened, the solution behaves as if it was added in a single operation.

- Adding Visual Studio solutions and projects to source control may fail if the Auto-Generate Item Identifier option is enabled in the Administration Console. In this case, the following error may occur:

  You must not specify Item Id when creating Items of type PROJECT as this will be generated automatically.

  To prevent this error, disable the Auto-Generate Item Identifier option in the Administration Console > Configuration Object Management > Object Type Definitions > Items. For details, see the Administration Console online help.

To add files to source control:

1. Choose what you want to add:

   Action | Description
   --- | ---
   Add a solution and the projects within it to source control. | Right-click the solution in Solution Explorer and select Add Solution to Source Control. Or select File >Source Control > Add Solution to Source Control. If you are connected to Dimensions CM, you can right-click a favorite project.
   Add a web project to source control. | Select the project (not the solution) in Solution Explorer. Select Add Selected Projects to Source Control.
   Add a project to source control without placing the solution under source control. | Right-click the project in Solution Explorer and select Add Project to Source Control. Within solutions that are not under source control, you can add only one project at a time.
   Add new projects to source control when the solution is already under source control. | Select one or more projects in Solution Explorer. Right-click the projects and select Add Project to Source Control.

2. If you are adding a web project, a dialog box may open. Click Continue.

3. If your current Visual Studio session is not yet logged in to Dimensions, or if current connection is the not correct one for the solution that you are working in, you may need to supply login information for Dimensions.

4. If you are adding a solution or a project in an uncontrolled solution, the Select Dimensions Project or Stream dialog box appears.

IMPORTANT! Your administrator can enable streams and/or projects. The following instructions apply to projects and streams.

5. Select the Dimensions CM project or stream to which you will add the Visual Studio project or solution. You can also create a new stream or project. Click Next.

6. If you are adding a solution or a project in an uncontrolled solution, select a destination folder in the repository, or a work area. If you select a work area, choose from these options:

- Create compatible work area: This is the default option for Visual Studio projects and solutions that reside outside of the default Visual Studio location. This option ensures that any Dimensions client may share the work area; for example, Visual Studio and the Desktop Client may update files in the work area. You can choose any folder that resides between the root system folder (we do not recommend choosing this) and the source control binding root folder. The binding root folder is typically at the root of the Visual Studio project and solution layout. If you are using a hierarchical layout with a single solution at the root, then the solution folder is the binding root. If you are using a parallel layout with solutions and projects at the same level, then the top level folder under which all solutions and project reside is the binding root. For example, in this hierarchical layout:

solution

project1

project2

The solution folder is the binding root. In this parallel layout:

root

projects

solutions

The root folder is the binding root.

The Selected Path setting is automatically set to reflect the correct offset from the location that you select. For example, if the solution file resides under C:\Work\MyProjects\Solution1 and you select a work area path of C:\Work, then Selected Path is automatically set to the correct offset, in this case \MyProjects\Solution1.

- Create work area for Visual Studio only: If the solution or project resides under the default Visual Studio location, this option will be selected and you cannot make another choice. This work area is not compatible with other Dimensions clients.

7. If the project or solution exists under a compatible work area (a work area that can be shared with other Dimensions CM clients), the wizard will preselect a repository path to match the work area path. The Create compatible work area option is selected by default (and is the only available option). A compatible work area root is either a folder set as default for the selected Dimensions project or stream, or it is based on Dimensions metadata that sets the work area root. Click Next.

8. (Optional) Select change requests to relate to the new files. You can select requests from the My Inbox and Favorites tabs. Click Next.

9. In the Select Design Part screen, you can select the design part that will contain all new items that you add. Your Dimensions CM administrator can guide you which design part to choose, if there is more than one. Click Next.

10. In the Options screen, enter a comment to apply to all of the files you are adding. Dimensions CM will store it as the file description for each file. Click Next.

11. On the summary page, review the choices and click Upload. To change any of the settings, click Back.

After the solution or project and associated files are added to source control, source control icons are displayed next to each file. For example, locked files that are not currently checked out have a blue lock icon. Files that are checked out have a red check mark.