Visual Studio:我可以复制一个项目的属性以在另一个项目中使用吗? [英] Visual Studio: can I copy a project's properties to use in another project?

查看:43
本文介绍了Visual Studio:我可以复制一个项目的属性以在另一个项目中使用吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Visual Studio 项目中添加了几个目录和库,例如 matlab、opencv 等,以编译我当前的 C 文件.

I've added several directories, libraries such as matlab, opencv, etc to compile my current C file in Visual Studio project.

我即将开展的所有项目都需要相同的设置/属性.我是否需要单独设置每个项目的属性,或者我可以做一些事情将其应用于所有项目?

All my upcoming projects will require the same setup/properties. Do I need to setup my each project's properties individually or I can do something to apply it to all ?

推荐答案

尝试使用属性表.这些可以创建可以被多个项目继承的单个属性文件.

Try using Property Sheets. These can create a single properties file that can be inherited by multiple projects.

  1. 使用查看 > 其他窗口 > 属性管理器"来调出属性管理器.它将显示您的项目和配置.

  1. Use "View > Other Windows > Property Manager" to bring up the Property Manager. It will show your projects and configurations.

右键单击配置,然后选择添加新项目属性表...".您可以为其命名,并选择一个适用于您所有项目的位置.

Right click a configuration, and select "Add New Project Property Sheet...". You can name it, and select a location that works for all your projects.

创建后,您可以像编辑构建配置一样编辑其属性.

Once created, you can edit its properties just as you would a build configuration.

要使用该属性表作为其他项目的基础,只需右键单击配置或项目,然后选择添加现有属性表...".浏览到您保存原始工作表的位置,它将被继承.

To use that property sheet as the basis for other projects, just right click the configuration or project, and select "Add Existing Property Sheet...". Browse to where you saved the original sheet, and it will be inherited.

对原始工作表的任何更改都将应用于继承它的任何项目,除非它们被覆盖.如果您进入链上层的属性,覆盖的属性的值将使用粗体类型.为了让他们始终使用基表中的值,将在适用的情况下提供从父级或项目默认值继承"选项.

Any changes to the original sheet will be applied to any project that inherits it, unless they are overridden. If you go into properties higher up the chain, properties that override will have bold type for their values. To get them to always use the value in the base sheet, there will be a "inherit from parent or project defaults" option where applicable.

这篇关于Visual Studio:我可以复制一个项目的属性以在另一个项目中使用吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆