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

1,315 views
Skip to first unread message

cswa...@me.com

unread,
Jun 2, 2016, 1:25:21 AM6/2/16
to SonarLint
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. I have tried with NuGet package 1.11 and 1.13

Any ideas on how to solve this?

Tamas Vajk

unread,
Jun 2, 2016, 4:40:05 AM6/2/16
to cswa...@me.com, SonarLint
Hello,

We haven't faced this issue before, so we'll need further information to solve this issue.
  • Can you create a repro that you can share with us? 
  • Does the build output contain any hints about the problem if you increase the verbosity? (Tools/Options/Projects and Solutions/Build)
  • Did you change project settings to treat warnings as errors? SonarLint by default only reports Warnings and Messages, which don't break the build.
  • You mentioned that you are using the SonarAnalyzer NuGet package. Do you use the VS extension (SonarLint for Visual Studio) too?
Thanks, 
Tamas

Tamas VAJK | SonarSource
Language Team


--
You received this message because you are subscribed to the Google Groups "SonarLint" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarlint+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarlint/99d4c305-fedc-4bdd-9417-749744e82e04%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

chase.a...@gmail.com

unread,
Jun 3, 2016, 1:17:01 PM6/3/16
to SonarLint, cswa...@me.com
Thank you for the response.

Your questions helped me locate the solution.

At some point, one of the projects and each of the affected solutions had the setting changed to treat warnings as errors and it was causing that project not to build.

Thank you for your help.

PS: Is there a setting that needs to be changed so SonarLint will lint JavaScript, HTML and CSS files inside of Visual Studio or is that a possible future enhancement?

Tamas Vajk

unread,
Jun 6, 2016, 2:25:57 AM6/6/16
to chase.a...@gmail.com, SonarLint, Chase Swanson
Hello, 

I'm glad I could help.
Currently only C# and VB.NET is being analyzed inside Visual Studio. Other languages will come later.

Regards,
Tamas

Tamas VAJK | SonarSource
Language Team

Reply all
Reply to author
Forward
0 new messages