title: How do I run SonarQube on a C#.NET project?
body: <p>I have a C#/.NET project that I want to scan using SonarQube (C# language).</p>
  
  <p>I am getting the scan to pass but with many errors (Over 200 repeated errors)</p>
  
  <pre><code>Provide an 'AssemblyVersion' attribute for this assembly.
  </code></pre>
  
  <p>This above message is repeated many times and accounts for a majority of SonarQube bugs I see in my report.</p>
  
  <p>SonarQube properties file</p>
  
  <pre><code># Comma-separated paths to directories with sources (required)
  #sonar.sources=controllers,services
  sonar.sources=.
  # Language
  sonar.language=cs
  
  sonar.visualstudio.solution=ProjectName.sln
  
  sonar.sourceEncoding=UTF-8
  sonar.cobol.copy.diretories=/copy
  sonar.visualstudio.enable=true
  </code></pre>
  
  <p>I even ran this msbuild (using MSBuild.exe Version 14 which I downloaded from <a href="https://www.microsoft.com/en-us/download/details.aspx?id=48159" rel="nofollow noreferrer">https://www.microsoft.com/en-us/download/details.aspx?id=48159</a>) batch file in my project</p>
  
  <pre><code>C:\Users\pwrdbyadmin\Desktop\sonar-scanner-msbuild-3.0.2.656\SonarQube.Scanner.MSBuild.exe begin /k:"org.sonarqube:sonarqube-scanner-msbuild" /n:"ProjectName" /v:"1.0"
  "C:\Program Files (x86)\MSBuild\14.0\Bin\amd64\MSBuild.exe"  /t:Rebuild
  C:\Users\pwrdbyadmin\Desktop\sonar-scanner-msbuild-3.0.2.656\SonarQube.Scanner.MSBuild.exe end
  </code></pre>
  
  <p><strong>Downloaded SonarQube 6.5 and ran following command to start server</strong></p>
  
  <pre><code>C:\Users\pwrdbyadmin\Desktop\sonarqube-6.5\bin\windows-x86-32\StartSonar.bat
  </code></pre>
  
  <p><strong>Command I run from within project</strong></p>
  
  <pre><code>C:\Users\username\Desktop\sonar-scanner-3.0.3.778-windows\bin\sonar-scanner.bat
  </code></pre>
  
  <p>I still cannot resolve many of the .NET errors in my project.</p>
  
  <p><strong>How can I resolve these obvious C# errors that come about after I run SonarQube on my project, do I need Visual Studio installed, do I need to build my project in Visual Studio? What are the proper steps I need to follow to scan my project?</strong></p>
  
  <p><strong>EDIT</strong></p>
  
  <p>The new three liner allowed analysis to work without any Insufficient Privilege error showing up at the end.   I used VS 2017's latest MSBuild.exe in my 3 line command</p>
  
  <pre><code>C:\Users\&lt;UserName&gt;\Desktop\sonar-scanner-msbuild-3.0.2.656\SonarQube.Scanner.MSBuild.exe begin /d:"sonar.host.url=http://localhost:9000" /d:"sonar.login=&lt;login&gt;" /d:"sonar.password=&lt;password&gt;" /k:"org.sonarqube:sonarqube-scanner-msbuild" /n:"&lt;ProjectName&gt;" /v:"1.0"
  "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.exe"  /t:Rebuild
  C:\Users\&lt;UserName&gt;\Desktop\sonar-scanner-msbuild-3.0.2.656\SonarQube.Scanner.MSBuild.exe end /d:"sonar.login=&lt;login&gt;" /d:"sonar.password=&lt;password&gt;"
  </code></pre>
  
  <p>In spite of using the updated command sequence, I still get the Assembly Version errors in my report.</p>
  
  <p>Do I need to delete the project and re-analyze.   Also, even thought my 3 liner shows MSBuild 15 used the yellow notice comes up saying I am using MSBuild 12.  I am not sure why.</p>
  
  <p><strong>UPDATE: Screenshot of duplicate files/folders in Code Smell Analysis.</strong></p>
  
  <p><a href="https://i.stack.imgur.com/HFmdd.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/HFmdd.png" alt="enter image description here"></a></p>