Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio: can I copy a project's properties to use in another project?

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 ?

like image 456
Louis Avatar asked Jun 17 '11 12:06

Louis


People also ask

How do I copy properties from one project to another in Visual Studio?

Open the shortcut menu for this item and then choose Add New Project Property Sheet. Specify a name and location. In Property Manager, open the new property sheet and then set the properties you want to include.

Where are Visual Studio project properties saved?

You'll find the Visual Studio project files in a locale-specific folder under the base directory, %VSINSTALLDIR%MSBuild\Microsoft\VC\<version> . The <version> is specific to the version of Visual Studio. It's v160 for Visual Studio 2019. Properties are also stored in any custom .


1 Answers

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

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

  2. 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.

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

  4. 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.

like image 196
AaronMK Avatar answered Oct 20 '22 09:10

AaronMK