How to use NCover
First install NCover3 on the machine running the build. In the settings.xml or pom.xml file, activate NCover with the following XML fragment "<useNCover>true</useNCover>" . This can also be done in the maven command line by adding "-DuseNCover=true".
How to use different tools for a specific dotnet solution
In the pom.xml of the solution you can override the settings found in the settings.xml file. This is just the standard maven mechanism.
How to know what command line is used to launch a tool
Add "-X" in the maven command line.
How to export a StyleCop / FXCop / Gendarme XML config file
Go in the quality profile page (configuration link at top of the screen) and then click on the "Export XML" links.
How to import a StyleCop / FXCop / Gendarme XML config file
In the same quality profile page, click at the bottom on the "create profile" link. Then choose C#, you will be able to import your configurations files. Nevertheless there is a restriction for StyleCop config files. If a rule is not present in your config file, sonar assumes that this rule is not active, even if that is not the standard behavior of StyleCop.
Also, there is a trick about priorities. The notion of priorities does not exist in StyleCop, Gendarme or FxCop. In order to store priority data in generated StyleCop XML config files, a SonarPriority attribute has been added. This attribute is just ignored by StyleCop. In Gendarme config files, this issue has been addressed by generating one rule set per priority level, plus one rule set containing everything (i.e. the default one).
How to analyse a .net4 solution ? (since version 0.4)
You need FxCop and StyleCop versions compatible with dotnet4. FxCop10 and StyleCop4.4 will fit. StyleCop4.4 is embedded in sonar dotnet since version 0.3 so you do not need to install it.
Samething with your test coverage tool. You can choose PartCover4 or NCover3.
Below an example of what could look like your maven setting.xml file :
How to analyse a silverlight solution ? (since version 0.4)
The only additionnal setting needed for silverlight is the path to mscorlib.dll assembly. This path should be specified in your maven settings.xml file using silverlight.X.mscorlib.location property where X equals 3 or 4.
How to analyse a solution with Silverlight3 projects and .net4 projects (since version 0.4)
In your pom.xml file, or in a maven profile, you need to set dotnet.tool.version and silverlight.version as follows :
The property silverlight.3.mscorlib.location need also to be set (rather in your setting.xml file to keep the build portable). Below an example on a Windows7 box :
How to use a custom output path ? How to use sonar dotnet if a tool such as SharpCrafters PostSharp is used to "enhance" the compiled code ? (since version 0.5)
The "maven-dotnet-plugin" has a parameter "assemblyDirectories" that can be used for this purpose. For a given visual studio solution, assembly directories can be specified project by project.
Let's say you have a solution containing a "Core" an a "Gui" project and instead of bin/Debug, the generated assemblies are generated in "binaries" folders. You will used something as below in the pom.xml file of the solution :
Let's say you want to analyse the "Cache" sample solution provided with the PostSharp (http://www.sharpcrafters.com) distribution. This solution contains a single "Cache" project. In order to specify "BeforePostSharp" directory to the FxCop and Gendarme plugins, you need to use the assemblyDirectories parameter in the pom configuration section of the maven dotnet plugin as below :
How to deal with VS solutions with weird structures ?
Let's say you have to analyse a solution where the sln file is located in a folder outside the source folder hierarchy.
Only source monitor will need special settings in order to work properly.
You need to specify the root source folder using property "dotnet.source.directory".
Tou will find an example in the svn of the project : http://svn.codehaus.org/sonar-plugins/trunk/dotnet/maven/dotnet-commons/src/test/resources/solution/ExampleUpsideDown/pom.xml