Compartilhar via


Criar configurações

Build configurations provide a way to store multiple versions of solution and project properties. The active configuration can be quickly accessed and changed, allowing you to easily build multiple configurations of the same project.

Por padrão e projetos criados com Visual Studio incluem configurações Debug e Release. Debug configurations are automatically configured for debugging an application, and Release configurations are configured for the final release of an application. For more information, see Como: Set Debug and Release Configurations. You can also create and edit your own custom solution and project configurations to meet the needs of your application. For more information, see Como: Criar e editar configurações.

Dois níveis de configurações de compilação podem ser definidos em Visual Studio: configurações de solução e projeto.

Solution Configurations

A solution configuration specifies how the projects in a solution are to be built and (if enabled) deployed. Para definir uma nova configuração de solução, abra o Caixa de Diálogo Configuration Manager e selecione nova da a configuração de solução ativa lista.

Each entry in a solution configuration includes a project name, a configuration setting, a platform setting, a build setting, and (if enabled) a deploy setting. The combination of solution configuration and solution platform settings chosen determines the project configuration that will be used. Para obter mais informações sobre plataformas de solução, consulte Plataformas de Compilação.

You can create any number of solution configurations, each with a unique name. O Visual Studio o ambiente de desenvolvimento integrado (IDE) atribui automaticamente as configurações de solução sempre que você:

  • Add a project platform with Create new solution platforms selected.

  • Add a project configuration with Create new solution configurations selected.

  • Add a new project that will be deployed on multiple platforms, one of which is new.

Solution configurations also provide general project context information to the IDE. For example, if the active solution configuration specifies that a project will be built for a mobile device, the Toolbox will display only project items that can be used in a mobile device project while you are working on that project.

Project Configurations

The project configuration and project platform are used together to specify the properties to use when building the project. A project can have a set of defined project properties for every unique combination of a configuration and platform. Project properties are edited with the Project Designer. Certain panes in the Project Designer contain dropdown lists that indicate the curent project configuration and platform combination.

You can define the configuration-dependent properties in each project configuration as needed. Project properties can be used to determine, for example, which project items will be included in a particular build, what output files will be created, where the output files will be put, and how they will be optimized.

Project configurations can differ considerably. The properties of one project configuration might, for example, specify that its output file be optimized so that the resulting binary occupies the minimum space, while another project might be optimized such that its executable runs at the maximum speed.

Project configurations are not stored by user, but by solution, so that they can be shared by a team. Although project dependencies are configuration-independent, only those projects specified in the active solution configuration will be built.

Changing Solution Configurations

Quando você criar uma solução Visual Studio usa a configuração de solução ativa, que especifica as configurações do projeto para usar para cada projeto seja construído. Você pode alterar a configuração ativa diretamente do Configurações de solução na lista suspensa na barra de ferramentas padrão ou a partir de Caixa de Diálogo Configuration Manager caixa de diálogo.

ObservaçãoObservação

Se você não conseguir encontrar solução as configurações na barra de ferramentas padrão ou não é possível acessar o Configuration Manager, você pode ter Visual Basic as configurações de desenvolvedor aplicadas. For more information, see Como: Gerenciar configurações de compilação com as configurações do desenvolvedor do Visual Basic aplicadas.

How the IDE Assigns Project Configurations to be Built

When you create a new solution configuration (rather than copy one that already exists), the IDE determines the default project configurations for the projects it will build using the following selection criteria for each project (evaluated in this order):

  1. The new solution configuration will build a project configuration whose name exactly matches its own. Configuration names are not case sensitive.

  2. If there is no exact name match, the new solution configuration will build a project configuration whose name matches the configuration portion of its name, whether or not the platform portion also matches. (Lembre-se de que a convenção de nomenclatura é <configuration name> <platform-name>.)

  3. If there is still no match, the new solution configuration will build the first configuration listed for a project.

How the IDE Assigns Solution Configurations

When you create a project configuration and select Create new solution configurations, the IDE looks for an appropriately named solution configuration to build the project on each platform it supports. In some cases, the IDE will rename existing solution configurations or create new ones.

The IDE determines how to assign solution configurations using the following selection criteria:

  • If a project configuration does not specify a platform or specifies a single platform, then a solution configuration whose name matches that of the new project configuration will either be found or added. Nesse caso, o nome dessa configuração de solução padrão não inclui um nome de plataforma; ele assume a forma <project configuration name>.

  • If a project supports multiple platforms, a solution configuration is found or added for each project configuration to build each project on each platform it supports. O nome de cada configuração da solução inclui o nome de configuração do projeto e o nome da plataforma; ele assume a forma <project configuration name> <platform name>.

Consulte também

Referência

Caixa de Diálogo Configuration Manager

Opções de Linha de Comando do Devenv

Conceitos

Projetos como Containers

Propriedades do projeto

Outros recursos

Criando no Visual Studio

Referência de construção C/C++