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 acc开发者_运维知识库eptable.
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.
You can customize the C# project template for Visual Studio, so that every time you create a new project it has all the settings you want.
http://msdn.microsoft.com/en-us/library/6db0hwky.aspx
http://www.a2zdotnet.com/View.aspx?Id=170
The closest equivalent is currently using regex from within VS on an unloaded project or writing something to process the msbuild xml backing the .csproj
files.
精彩评论