Samitha Chathuranga
Samitha Chathuranga

Reputation: 1749

Visual Studio 2013: How to copy a project's properties to use in another project?

I tried to copy a project's properties to use in another project as instructed in the stackoverflow question Visual Studio: can I copy a project's properties to use in another project? but it does not work. When I open the created PropertySheet it seems that nothing is copied to it from the original property settings. The above link seems to be for VS 2008 but now I am using 2013. What might be the fault.

Upvotes: 3

Views: 935

Answers (1)

Ilya
Ilya

Reputation: 114

Caveat: Tested only on a relatively basic C++ project. But it worked!

  1. Right click on your source project (in the solution explorer)
  2. Unload project
  3. Right click on your destination project and unload that as well.
  4. Right click on each project and Edit {project}.vcxproj. The projects' configuration files can now be edited. (Yes you could also just find the file and edit it directly)
  5. Copy/replace elements from the source to the destination.
  6. Reload both projects. They should reload withut problems.

Tips:

  • If the reload did not work then copy/replace in pieces instead of the entire project to isolate the problem.
  • Don't replace the "ItemGroup" and the "Globals" PropertyGroup because these (XML) elements identify the projects in the context of the solution. But you should be able to copy/paste everything below these elements from the source .vcxproj file to the destination one without problems.
  • Try this on two "empty" projects before proceeding to your magnum opus. And definitely make a backup of your projects before trying this. (you are reading all of this before starting, right? Of course you are...)

This solution works better than others I have seen because it sets and unsets settings completely. It's a total replacement, not just an additive one.

Upvotes: 1

Related Questions