Search code examples
visual-studiosonarqubesonarlint

VS Solution no longer builds once the SonarAnalyzer.CSharp is added to solution


We are new adopters of SonarQube and I am going through the process of binding our solutions to SonarLint from SonarSource.

Some solutions work fine, but several of them have build errors once I install the NuGet package SonarAnalyzer.CSharp. If I remove it, the solution will once again build correctly.

Sample Error

error CS0006: Metadata file 'C:\Users\cswanson\Desktop\Repos\DI\CardDI\Card.Domain\bin\Debug\Card.Domain.dll' could not be found

Sure enough, that project in the solution did not build and output to bin.

Looking at the build output for that project, there are several S### errors reported but nothing alerting why the project did not build.

We are on using Visual Studio 2015 Professional Update 2.

Any ideas on how to solve this?


Solution

  • The issue was that the properties on a specific project inside the solution had been set to treat warnings as errors, stopping the build.

    Changing this setting allowed the solution to build correctly.

    Thank you to Tamas Vajk at SonarSource for the guidance.