Canarys | IT Services


Performing Sonar Analysis for .NET projects


Sonar Integration with TFS build for .net projects

This document provides details about TFS and Sonar integration for .Net projects. The .net projects can be analyzed using solution properties or adding invoke process in the build process template.


Sonar media download link.

Installing Sonar.

1.Download sonar-3.7 and sonar-runner-2.3*** unzip folders and copy the contents in c drive.

Sonar Files

2.Run StartSonar bat files. from :-> sonar-3.7

Sonar Installation

3.       Download sonar plug-in for .net from the below link:

Download and copy .jar files to “C:sonar-3.7extensionsplug-ins” and start sonar runner.

Sonar Plug-in's for .net

The below steps describes both the procedures:

Using Solution Properties

1.       Define for you project.



sonar.projectName=My CSHARP Application

# Info required for SonarQube

sonar.sources=.   # Always set it this way even if this property is not used


2.       Add below line of snippets for  post build event

3.       C:sonar-runner-2.3binsonar-runner.bat -Dproject.home=”$(SolutionDir).” -Dproject.settings=”$(SolutionDir)”

Or Using Invoke Process

4.      Customize the BuildProcessTemplate. Add InvokeProcess to BuildProcessTemplate locate the

Run On Agent  à Try Compile, Test, and Associate Changesets and Work Items activity.

Customize TFS Build Process Template

5.      Arguments : SourcesDirectory + “

6.      FileName: “C:soanr-runner-2.3binsonar-runner.bat

Leave a Reply

Your email address will not be published. Required fields are marked *

Reach Us

With Canarys,
Let’s Plan. Grow. Strive. Succeed.