Search code examples
c#visual-studio-2010configurationmultiple-projects

Is there an equivalent to the "Property Manager" for C# projects (for common project settings)?


You can use the Property Manager window in Visual Studio for managing common properties of C++ projects, but there appears to be no equivalent to this for C# projects.

Is there a way to set common settings across multiple projects? Examples of things I'd like to do:

  • add TEST preprocessor directive for all projects that have a TEST build configuration
  • change warnings to errors for all C# projects
  • add a reference to some common assembly for N selected C# projects at once
  • etc.

A plugin, macro, or extension would all be acceptable.


Solution

  • There is no a real equivalent of Property Manager for C# projects. However, if the goal is to share common settings across multiple projects, you can create a NuGet package with .props file defining the shared properties and reference it in your C# projects - VS will automatically import it at build time.

    .props and .targets inclusion is supported as of NuGet 2.x. Tip: make sure the .props file name matches the NuGet package id, otherwise it won't be included. You can see an example here.