How do you build your Visual Studio solution, verify your coding guidelines and execute tests?
What steps do you take when adding a new project to your Visual Studio solution?
Living in the past
Let me summarize my past experience. I have tried several different approaches, all of them involved build scripts, and Visual Studio Project Templates or manual editing of *.csproj files. I don’t like any of the approaches. Why? I will show you some drawbacks of this kind of build definitions.
- you have to learn a scripting language
- you try to solve problems which you would solve in your preferred .NET language with less effort
Visual Studio Project Templates:
- making up-to-date versions available to all team members is a PITA (pain in the
- update your templates and you still have to update all previously existing *.csproj files manually
- if you change your build process (e.g. enable StyleCop) you have to release and distribute a new version of your templates
Imagine the unimaginable
In our projects we heavily rely on the Microsoft FxCop engine. FxCop prevents us from making stupid programming mistakes like forgetting to dispose a disposable object etc. For a long time we used the FxCop engine 10.0 which has a command line integration for continuous integration environments. Lately we discovered that the VS2010 integrated FxCop has a much stronger analysis engine and more rule sets which could improve our code base even further. But how do you get the VS2010 integrated fxcop running on continuous integration without having to install VS2010 on the build machine? I’ll show you how!
I was developing a large wrapper library for some classes from System.IO. I wanted to use the original documentation from mscorlib for my wrapper classes because the methods and properties only wrap the underlying components from System.IO. This is easily possible with the document include tag.
public interface IExample
/// <include file='relativepathtodocument.xml'
But there is a bug in the latest msbuild version which can drive you nuts if you don’t know what to look for.