VS2008 Project settings transfer

Started by
2 comments, last by Spoonbender 15 years, 6 months ago
Given projects have their settings to ensure compiling, I normally get lost and forget where certain things I set are. Can't I just transfer all settings from a working project to a new one? I swear, Google must hate me since I never find anything I'm looking for. I'm obviously not good with keywords.
Advertisement
Yes you can. :)

For C++ projects, the magic word is 'property sheets'. Basically an xml file containing user-specified defaults.

To create one:
Go into View -> Other Windows -> Property Manager
Right click on your project in the property manager, and 'add new property sheet'. Give it a name, and then doubleclick on the resulting property sheet. It opens the usual property pages window, except these settings are stored in the property sheet.

Any project can now include this property sheet (either 'add existing property sheet' in the property manager, or 'Inherited Project Property Sheets' in the general tab on a project's regular property pages.

The only thing to be aware of is that individual projects can still override settings (And when you create a new project, a dozen settings are overridden by default, which means you have to reset them). Anything in bold in the project properties is overridden, so you need to reset it to 'Inherit from parent or project defaults' for the value defined in the property sheet to take effect.

In other languages which use MSBuild, the same is possible with .target files, but haven't used this, so can't explain it in detail.
Quote:
In other languages which use MSBuild, the same is possible with .target files, but haven't used this, so can't explain it in detail.

The MSBuild mechanism is vastly more flexible and powerful than the VCBuild property sheet mechanism... unfortunately, as far as I'm aware, the IDE support for the same is vastly inferior to the VCBuild analogue -- you have to unload the project and hand-edit the MSBuild file. :(
Yeah, what I've seen of the MSBuild equivalent looks nice.
And seems like VS10 is going to use that for C++ *and* add IDE support for it. Looks nice. [grin]

This topic is closed to new replies.

Advertisement