Add a project to a solution under source control
You can add a project to a solution that is under source control the same way you would add a project to a solution that is not under source control. There are a few differences that are specific to source control that are listed in the following procedures.
For information about how to add a project to source control using Microsoft Visual Studio Team System Team Explorer, see How to: Add a Project or Solution to Version Control on MSDN.
Add projects to a solution under source control
To add a new project to a solution under source control
Add a new project.
For more information, see Add a new or existing project to a solution.
Importante Make sure that you create the new project in the solution folder in your local Microsoft Team Foundation workspace. Otherwise, Team Foundation will not be able to find the new project files.
The project is added to your solution, and the solution file is modified to list the new project files. Each newly created file is identified by a plus sign , and a check mark appears next to the solution file to show that it is checked out to you.
The Projects panel after you add a project named Flavors
As a best practice, build (Ctrl+Shift+B) or run (F5) your solution before checking it in to make sure that nothing is broken.
Check in the new files and the changed solution file.
For more information, see Check files in and out.
To add an existing project to a solution under source control
Copy the existing project folder to the solution folder in your local Microsoft Team Foundation workspace.
Add the existing project.
For more information, see Add a new or existing project to a solution.
The existing project is added to your solution, and the solution file is modified to list the project files. Each added file is identified by a plus signs , and a check mark appears next to the solution file to show that it is checked out to you.
[!NOTA]
If you see locks next to the project files instead of plus signs , you might be adding a project that previously existed in the solution but was removed (though not deleted from your hard disk).
As a best practice, build (Ctrl+Shift+B) or run (F5) your solution before checking it in to make sure that nothing is broken.
Check in the added files and the changed solution file.
For more information, see Check files in and out.
Delete projects from a solution under source control
To delete a new project that has not yet been checked in
Right-click the new project, and then click Undo Pending Changes.
Sugerencia By right-clicking the new project instead of the solution, you make sure that only the new project files are selected in the Undo Pending Changes dialog box. Any other pending changes will not be selected, so those changes will not be undone.
Select the solution file, because it was modified to add a reference to the new project and you want to undo that change.
Precaución If there is a chance that the solution file has some other changes that have not yet been checked in, compare your current local version to the version that was last checked in. For more information, see View or compare the changes made to files. If the only difference in your solution file is the line that references the new project that you want to delete, you can safely select the solution file to undo the changes. If there are other changes that you need to keep, do not select the solution file. Instead, after completing this procedure, open the solution file in a text editor and manually remove the reference to the project. You can then check in the solution file along with the other file changes that are related to the changes made in the solution file.
Click Undo Pending Changes.
The new project is deleted from the solution and from source control, without deleting the new project folder from your hard disk. It is a good idea to build (Ctrl+Shift+B) or run (F5) your solution to make sure nothing is broken before making further changes to the solution.
To delete an existing project from a solution under source control
Open the solution in Microsoft Visual Studio 2010 Team System. You must use Visual Studio 2010 because you cannot open a solution in Team Explorer, and you cannot delete a project from source control using Blend.
Importante You might be tempted to right-click the project folder in the Source Control Explorer panel of Visual Studio 2010 and click Delete, but this will not remove the reference to the project in the solution file. To remove a project and any references to the project, you must do so in the Solution Explorer panel with the solution open.
If you do not see the Solution Explorer panel, click View, and then click Solution Explorer.
Right-click the project that you want to delete, and then click Remove.
The project is removed from the solution and deleted from the Team Foundation server, without deleting the new project folder from your hard disk. The solution file is checked out to you and modified to remove any reference to the project. If you want, you can manually delete the project folder from your hard disk.
Build (Ctrl+Shift+B) or run (F5) your solution to make sure nothing is broken.
Right-click the solution, and then click Check In.
In the Check In dialog box, make sure all the files that you want to check in (including the solution file) are selected, and then click Check In.
Vea también
Tareas
Rename or delete a file under source control