[WARNING] No analyzers were found in package

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension) :
  • what are you trying to achieve: Write custom c# analyzers using Roslyn SDK in Visual Studio
  • what have you tried so far to achieve this:

I have written some custom c# analyzers using the Roslyn SDK in VS2017 and 2019, and have tested them against a fresh instance of VS, by adding the NuGet package generated from the analyzer project and importing them in a new VS project and have also tested them with unit test cases.
I am using RoslynSonarQubePluginGenerator v2.0 GitHub - SonarSource/sonarqube-roslyn-sdk: SDK for SonarQube Roslyn Analyzer Plugins to generate a jar from the corresponding NuGet package but every time I get the error - No analyzers were found in this package.
Initially, I was using .NET Standard 1.3 in VS (using the template provided by VS for Code Analyzers and Code Fixes - screenshot attached) but then I got the error - No package was found so I switched to .NET Standard 1.4 and then that error was solved but then, I started getting the error - No analyzers were found in this package.

I am unable to generate the jar from my NuGet package. I tried to generate the jar of a dummy VS Code Analyzer project and there also I get the same error.

Any suggestions/recommendations will be really helpful!

Hi @dishavirk

Welcome to our community!

Would it be possible to share the dummy VS Code Analyzer project that you used to reproduce the problem? This will help us a lot.

Also, what Roslyn version your analyzers use? Currently only Roslyn 2.8.2 or lower are supported.

Thank you,

1 Like