4

Visual Studio 2017 (15.7.4) with SonarLint 4.1.0.3539 extension installed.

Loaded ASP.NET Core 2.0 solution, which consists of projects, targeting either .Net Framework 4.7.1 or .Net Standard 2.0. Csproj files are new "minimal" version with added this

<CodeAnalysisRuleSet>..\..\..\custom.ruleset</CodeAnalysisRuleSet>

Visual Studio Options => Text Editor => C# => Advanced => Enable full solution analysis is checked (enabled).

Problem: Running Rebuild or Run Code Analysis for whole solution does not show any Sonar warnings in Errors pane. At same time in code editor there are those squirly underlines pinpointing Sonar found problems in code.

Q: Are there any additional configurations necessary to make it work or ASP.NET Core and .Net Standard projects are not yet supported for this?

P.S. SonarLint is not connected to any SonarQube server.

2 Answers2

1

Once changing to "Build and Intellisense" in the Error List, the errors showed up here. A rebuild is of course also required after setting up the SonarLint connection.

Error List in VS 2019

clemensoe
  • 312
  • 2
  • 9
0

I ended up here having "theoretically" the same issue. I'm currently using Visual Studio 2022. So, I don't know if it was the same for 2017. I tried what was mentioned by @clemensoe but I already have it like that (Build + Intellisense) and did not solve my issue. What, in my case, there is an extra configuration is a .editorconfig file

So what I have done to see some of the analysis findings as warnings, is to have this file and enable some of these for instance CA as warnings like in the image below: enter image description here

I hope this might help you or others with a similar situation.

Sebastian Inones
  • 1,561
  • 1
  • 19
  • 32