How to share properties between multiple Visual Studio projects? (especially C# projects)

Keeping properties of multiple Visual Studio projects manually in sync is annoying. So, how can you share properties between multiple projects?

Edit: I refer to properties like conditional compilation symbols, treatment of warnings and errors etc., i.e., things you can configure in Project->Properties tabs or by editing the project XML file.

Similar questions have been asked before, see: 1, 2 and 3. However, in my understanding, the answers have been C++-specific. I am looking for an answer for C# projects. Nevertheless, do not hesitate to answer for other kinds of projects (Visual Basic etc.) if you keep the separation clear, because someone else than me might be interested.

This blog post proposes a solution to the problem, but I would prefer something simpler.

Also, you can at least solve a part of the problem in the following way (note that although I tested it, I did not test it thoroughly):

Create an AssemblyInfo.cs file with the assembly attributes you intend to share. Link to this existing item in the individual projects. Use the original (local) AssemblyInfo.cs and put project-specific assembly attributes there. Unfortunately, overriding attributes does not seem to work, and managing the attributes via the GUI is now limited.

9
задан Community 23 May 2017 в 02:34
поделиться