管理项目和解决方案属性Manage project and solution properties

项目具有一些控制编译、调试、测试和部署的很多方面的属性。Projects have properties that govern many aspects of compilation, debugging, testing and deploying. 有些属性在所有项目类型中是通用的,而有些则只用于特定语言或平台。Some properties are common among all project types, and some are unique to specific languages or platforms. 右键单击“解决方案资源管理器” 中的项目节点并选择“属性” ,或者在菜单栏上的搜索框中键入“属性” 并从结果中选择“属性窗口” ,即可访问项目属性。You access project properties by right-clicking the project node in Solution Explorer and choosing Properties or by typing properties into the search box on the menu bar and choosing Properties Window from the results.

项目上下文菜单

在项目树本身,.NET 项目也可能具有一个属性节点。.NET projects might also have a properties node in the project tree itself.

解决方案资源管理器树中的属性节点

Note

本主题适用于 Visual Studio Windows 版。This topic applies to Visual Studio on Windows. 对于 Visual Studio for Mac,请参阅管理解决方案和项目属性 (Visual Studio for Mac)For Visual Studio for Mac, see Managing solution and project properties (Visual Studio for Mac).

项目属性Project properties

项目属性分到各个组且每组具有自己的属性页。Project properties are organized into groups, and each group has its own property page. 这些页面可能因语言和项目类型不同而有所不同。The pages might be different for different languages and project types.

C#、Visual Basic 和 F# 项目C#, Visual Basic, and F# projects

在 C#、Visual Basic 和 F# 项目中,属性在“项目设计器” 中公开。In C#, Visual Basic, and F# projects, properties are exposed in the Project Designer. 下图显示了 C# 中的 WPF 项目的生成属性页 :The following illustration shows the Build property page for a WPF project in C#:

Visual Studio 项目设计器

有关“项目设计器”中每个属性页的信息,请参阅项目属性引用For information about each of the property pages in Project Designer, see Project properties reference.

Tip

解决方案和项目项都具有一些属性;这些属性可在属性窗口中访问,而不是在项目设计器中访问。Solutions have a few properties, and so do project items; these properties are accessed in the Properties window, not Project Designer.

C++ 和 JavaScript 项目C++ and JavaScript projects

C++ 和 JavaScript 项目对于管理项目属性有不同的用户界面。C++ and JavaScript projects have a different user interface for managing project properties. 此图显示了 C++ 项目属性页(JavaScript 页面与此类似):This illustration shows a C++ project property page (JavaScript pages are similar):

Visual C++ 项目属性

有关 C++ 项目属性的信息,请参阅使用项目属性 (C++)For information about C++ project properties, see Work with project properties (C++). 有关 JavaScript 属性的详细信息,请参阅属性页,JavaScriptFor more information about JavaScript properties, see Property pages, JavaScript.

解决方案属性Solution properties

若要访问解决方案上的属性,请右键单击“解决方案资源管理器” 中的解决方案节点,然后选择“属性” 。To access properties on the solution, right click the solution node in Solution Explorer and choose Properties. 在对话框中,可以设置用于“调试”或“发布”版本的项目配置,选择按下 F5 时应启动的项目,然后设置代码分析选项 。In the dialog, you can set project configurations for Debug or Release builds, choose which projects should be the startup project when F5 is pressed, and set code analysis options.

请参阅See also