VS Project Property Sheet

随着解决方案中项目的增加,管理项目设置变得复杂。本文介绍如何使用Visual Studio中的属性管理器来创建和编辑项目属性表(.vsprops文件),实现多个项目配置的统一管理。文章还解释了用户定义宏的作用,并提供了具体的使用步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

VS project property sheet
As projects in a solution grow more and more, the project setting management will be more and more complicated. Modifying one by one will be hard work and easy to cause mistakes. Luckily, VS has already provides us a way to manage such area work by "Property Manager" which can create/edit finally manage "Project property sheet" thing.

1. Several Concepts
--Project Property Sheet
A project property sheet is an .xml file with the extension .vsprops. You can use property sheets to create project configurations that can be applied to multiple projects since project settings that are defined in .vsprops files are inheritable, unlike project settings defined in Project Files (.vcproj files). Therefore, a project configuration defined in a .vcproj file can inherit project settings from one or more property sheets (.vsprops files).
--User-defined Macros
We will always see a lot of predefined macros like $(solution), $(outdir). We can define ours by project property sheet. There is a "User Macros" there. They are defined in .vsprops files directly.
Note: there are actually two ways to define user-defined macros: one is described as above; the other is to define them directly as environment variables.

2. How to use a Project property sheet
1) Create one. Use property manager.
2) In every C++ project setting's general area, there is a "Inherited Project Property Sheets", where we can specify those .vsprops files to inherit from.
3) To inherit the settings: for those setting which can have only one input like "Output directory", you can choose "inherit from parent or project defaults” directly; for those settings which can have multiply inputs like "Additional Include Directory", the inheritance is done automatically.

In a word, for a solution, if preparing well a .vsprops to contain common settings, and let it be inherited by its projects, we can manage project settings easily!

Note this article into blog: http://www.itwis.com/html/c/ctool/20070904/1.html

转载于:https://www.cnblogs.com/taoxu0903/archive/2009/02/21/1395418.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值