Partilhar via


Create parent container folders for solutions

Applies to: yesVisual Studio noVisual Studio for Mac

Note

This article applies to Visual Studio 2017. If you're looking for the latest Visual Studio documentation, see Visual Studio documentation. We recommend upgrading to the latest version of Visual Studio. Download it here

In the Source Control Plug-in API Version 1.2, a user can specify a single root source control destination for all web projects within the solution. This single root is called a Super Unified Root (SUR).

In the Source Control Plug-in API Version 1.1, if the user added a multiproject solution to source control, the user was prompted to specify one source control destination for each web project.

New capability flags

SCC_CAP_CREATESUBPROJECT

SCC_CAP_GETPARENTPROJECT

New functions

The Visual Studio IDE almost always creates an SUR folder when adding a solution to source control. Specifically, it does so in the following cases:

  • The project is a file share web project.

  • There are different drives for the project and the solution file.

  • There are different shares for the project and the solution file.

  • Projects were added separately (in a source-controlled solution).

In Visual Studio, it is suggested that the name for the SUR folder be the same as the solution name without the extension. The following table summarizes the behavior in the two versions.

Feature Source Control Plug-in API Version 1.1 Source Control Plug-in API Version 1.2
Add solution to SCC SccInitialize()

SccGetProjPath()

SccGetProjPath()

SccOpenProject()
SccInitialize()

SccGetProjPath()

SccCreateSubProject()

SccCreateSubProject()

SccOpenProject()
Add project to source-controlled solution SccGetProjPath()

OpenProject()
SccGetParentProjectPath()

SccOpenProject()

Note: Visual Studio assumes that a solution is a direct child of the SUR.

Examples

The following table lists two examples. In both cases, the Visual Studio user is prompted for a destination location for the solution under source control until the user_choice is specified as a destination. When the user_choice is specified, the solution and two projects are added without prompting the user for source control destinations.

Solution contains On disk locations Database default structure
sln1.sln

Web1

Web2
C:\Solutions\sln1

C:\Inetpub\wwwroot\Web1

\\server\wwwroot$\Web2
$/<user_choice>/sln1

$/<user_choice>/C/Web1

$/<user_choice>/Web2
sln1.sln

Web1

Win1
C:\Solutions\sln1

D:\Inetpub\wwwroot\Web1

C:\solutions\sln1\Win1
$/<user_choice>/sln1

$/<user_choice>/D/web1

$/<user_choice>/sln1/win1

The SUR folder and subfolders are created regardless of whether the operation is canceled or fails due to an error. They are not automatically removed in cancel or error conditions.

Visual Studio defaults to Version 1.1 behavior if the source control plug-in does not return SCC_CAP_CREATESUBPROJECT and SCC_CAP_GETPARENTPROJECT capability flags. Additionally, users of Visual Studio can choose to revert to the Version 1.1 behavior by setting the value of the following key to dword:00000001:

[HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\8.0\SourceControl] DoNotCreateSolutionRootFolderInSourceControl = dword:00000001

See also