Export (0) Print
Expand All

Visual Studio Solutions and Web Project Source Control

If you are working in a solution that contains multiple Web projects, you can put the entire solution under source control as a unit. Working with a multiple Web site project solution is much the same as working with a single Web site project. The same functions are available, including the ability to check in or out an entire solution at once.

If you are adding a solution to source control that contains more than one Web project, Visual Studio creates a different structure in the source control repository than it does for a single project. For solutions that contain projects in a path that is relative to the solution file, Visual Studio creates a nested project structure in your source control repository. For example, if you have a solution file in C:\WebSites\SampleSolution.sln, and you have a Web site in C:\WebSites\SampleWebs\Web1, these paths are considered relative. Visual Studio attempts to maintain the relative structure. Any additional Web sites that are in the solution are created as separate child projects using the name that you assigned to the Web site.

Visual Studio initially creates a project with the extension .root. This project acts as the parent project for the individual Web project. Within the parent project, Visual Studio creates a structure that looks similar to the following:

  • <SolutionName>.root

    • <SolutionName>\<relative path to the solution file>

      Stores the .sln file with the solution and project configuration settings.

    • <SolutionName>\<relative path to Web project>

      Stores the files for a project in the solution. In Visual Studio, the first project that you create in a solution has the same name as the solution. Thus, Visual Studio assigns the suffix _1 to the source control project for the project, which distinguishes it from the source control project that stores solution settings.

    • <name of non-relative project>

      Stores files for an additional project in the solution.

    • <name of client project>

      Stores client project files.

When you use Visual Studio to retrieve a copy of the solution from source control for the first time, Visual Studio creates the correct structure on your computer.

If you enlist in a solution that contains a Microsoft Internet Information Services (IIS) Web site project that does not already exist on the local computer, Visual Studio creates the Web site project beside the solution structure and points your virtual directory to that location.

If you enlist in a solution that contains an IIS Web site project, and the virtual directory for the Web site already exists on your local computer, Visual Studio displays a dialog box asking if you want to add the files from source control to the existing Web site instead of creating a new folder. If you click Yes, Visual Studio uses the existing location. If you click No, Visual Studio creates a new folder with an underscore and a 1 (_1) appended to the name.

When you check out files in Visual Studio, your local version of the file is checked out in source control.

Community Additions

ADD
Show:
© 2014 Microsoft