Compartilhar via


Como: Adicionar e remover itens de solução

In Visual Studio, a solution is the highest level of organization, followed by a project. A solution can contain one or more projects. A project, in turn, contains items. Many types of items are possible and the items available for a particular project vary with the type of project. Itens incluem, mas não estão limitadas a: arquivos, classes, datasets, formulários e relatórios.

Files are one type of item

Gráifoc de itens físicos virtuais

Solutions contain projects and the items that those projects contain. Soluções também podem conter itens que não pertencem a um projeto específico: itens independentes de projeto. Dois tipos de itens project-independent existem no Visual Studio: itens de solução e miscellaneous files.

Solution items are associated with a solution and managed by the Solution Items folder in Solution Explorer.

If you want to work on files outside the context of a solution or a project, create miscellaneous files that are managed by the Miscellaneous Files folder. For more information about miscellaneous files, see Arquivos variados.

Project independent items

Solução de projeto

Solution items are internal items. They can be referenced by projects, but are never included in solution or project builds. This topic outlines the process of adding and removing items to the Solution Items folder.

ObservaçãoObservação

If placed under Source Control, solution items must reside on the same logical or physical drive as the solution files (.sln and .suo) to maintain one root in the Source Code Control database.

Adding Solution Items

If you want to permanently associate an item with your solution, you can either create a new item or add an existing item.

To add a new solution item

  1. In Solution Explorer, select the Solution node.

  2. On the Project menu, choose Add New Item.

  3. From Add New Item - Solution Items dialog box, choose a template.

  4. Choose Open to add the item to the Solution Items folder.

To add an existing item to a solution

  1. In Solution Explorer, select the solution.

  2. On the Project menu, choose Add Existing Item.

  3. From Add New Solution Item, choose the item you want to add.

  4. Choose Open to add the item to the Solution Items folder.

For more information, see Add Existing Item - Solution Items Dialog Box.

Removing Solution Items

You can remove an item from the Solution Items folder. Removing is not the same as permanently deleting an item. Removing takes away the item's association with the solution. The file that represents the former item still remains on disk.

To remove a solution item

  1. In Solution Explorer, select the item you want to remove.

  2. On the Edit menu, choose Remove.

  3. You can re-add the item as long as the file for the item still exists.

    Dica

    To permanently delete a file from storage, use Windows Explorer.

Consulte também

Tarefas

How to: Excluir itens de um projeto de implantação

Como: Adicionar novos itens de projeto

Conceitos

Itens solução

Soluções como Containers

Usando o Solution Explorer

Arquivos variados