-3

I am trying to integrate my C# 4.O and VS2010 projects with SonarQube 5.1.2. As per this SonarQube supports only VS2013+ and Microsoft .NET Framework v4.5.2+.

Any Suggestions or reference link for setting SonarQube for VS2010. I am following C# Plugin .

G. Ann - SonarSource Team
  • 22,346
  • 4
  • 40
  • 76
Prasad Kanaparthi
  • 6,423
  • 4
  • 35
  • 62

1 Answers1

3

The document you referenced actually mentions that the support of Visual Studio 2010 has not yet been tested (hence the question mark in its support status). I believe it will work, as the support of MSBuild 4.0 has been tested, and that should be the MSBuild version shipping with VS2010.

Since you tagged your question with [sonar-runner], I'd just like to clarify that the only recommended way to analyze .NET projects is through the MSBuild SonarQube Runner, which is a different product than the sonar-runner.

Just follow the steps on https://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner+for+MSBuild - you can make things easier by trying to analyze the provided example project first, before trying it on your own projects.

EDIT 2015-09-07

On your build agent, you'll have to install the .NET Framework 4.5.2 or higher for the MSBuild SonarQube Runner to run. However, you can build your project with an MSBuild version as low as 4.0: Analyzing .NET projects in SonarQube from the command line or TFS works with Visual Studio 2010 & higher and MSBuild 4.0 & higher. But SonarLint, the extension for Visual Studio to detect issues as you type in real-time, only works with version 2015 as it is based on the Roslyn technology. SonarQube and SonarLint VS and 2 separate and independent products, which have different requirements.

  1. MSBuild.SonarQube.Runner.exe begin /k:SQ_project_key /n:SQ_project_name /v:SQ_project_version this will require the .NET Framework 4.5.2
  2. Build your project: msbuild You can invoke MSBuild 4.0, 12 or 14 here
  3. MSBuild.SonarQube.Runner.exe end this will again require the .NET Framework 4.5.2 to be installed
G. Ann - SonarSource Team
  • 22,346
  • 4
  • 40
  • 76
Dinesh Bolkensteyn
  • 2,971
  • 1
  • 17
  • 20
  • Thanks for reply. What is the purpose of this SonarQube server (http://localhost:9000) How does it related to C#. My assumption is If C# project is configured with SonarQube the rules and stats will display in Visual Studio and in SonarQube server. Am i correct ? – Prasad Kanaparthi Sep 03 '15 at 05:37
  • 1
    There might be a bit of confusion here. You can install SonarLint for Visual Studio 2015 in your IDE, without requiring any SonarQube server to be installed (see http://vs.sonarlint.org/). However, if you want to analyze your project using SonarQube (see http://nemo.sonarqube.org/ for an example live server instance), then you'll have to set it up, and `localhost:9000` is just the default host and port of it. Change it into your own SonarQube server host and port. – Dinesh Bolkensteyn Sep 03 '15 at 06:41
  • I've updated my answer, hope it clarifies that SonarQube and SonarLint are 2 independent products that have different minimal Visual Studio version requirements – Dinesh Bolkensteyn Sep 07 '15 at 09:40
  • 2
    Please send another question that mentions exactly what the issue is: You can't just say "i followed this doc and it doesn't work for VS2010", you need to mention exactly what you did and what is failing. Do you want to setup a SonarQube analysis or use SonarLint in Visual Studio? – Dinesh Bolkensteyn Sep 08 '15 at 05:52
  • Thanks all your support. I am looking something like this... finally got it from http://sharedtolearn.blogspot.in/2012/10/install-and-configure-sonar-on-windows.html. Thanks – Prasad Kanaparthi Sep 08 '15 at 08:04
  • Sorry.. I was like i want to swim in ocean without any swimming experience. Starting reading word by word in this http://redirect.sonarsource.com/doc/sq-setup-guide-for-dotnet-users.html and i am able to get the things done. Well documented. Great. – Prasad Kanaparthi Sep 11 '15 at 05:17
  • No worries, it happens to all of us from times to times. I'm glad you managed to get the MSBuild SonarQube Runner to work! :-) – Dinesh Bolkensteyn Sep 11 '15 at 10:14
  • Finally.. finally I was able to see my projects results in SonarQube server. Nice stats & graphs.. great tool. – Prasad Kanaparthi Sep 14 '15 at 09:57
  • With .NET Framework 4.0 also i was able to run above 1,2,3 commands and are working fine. The results are displaying in SonarQube dashboard. – Prasad Kanaparthi Sep 30 '15 at 03:40