I'd like to be able to validate my .csproj
files either as they are added to the solution, or when they are built on our CI build server.
Validation would mean checking, for example:
- that the path and project file name match conventions
- that the assembly name and namespace match naming conventions
- that the platform target is correct
- that the output paths are correct (Release and Debug)
- that the warnings level is correct and warnings are treated as errors
- that certain files are present in the project (
AssemblyInfo.cs
etc). - that assemblies have been correctly referenced
- etc
Another useful feature would be the ability to ignore certain projects, or better still, to be able to define project groupings, with each group having its own validation rules.
This seems to me to be a problem that many others must have, however I have not yet found any tool which could help simplify or automate this process. I'd imagine it to be something like StyleCop or FxCop perhaps.
Does such a tool exist or must I create my own custom build step?
(I am also using ReSharper, so would consider plugins, although this might make validation on the build server more difficult.)