Reputation: 87
I am trying to write custom rules in sonar for C#. After doing some research, got something on how to write rules and integrate with sonar. For the reference please look at the post https://stackoverflow.com/a/53889326/6499361.
So basically we have to follow three steps to do so:
I have written analyzer code which works fine.I have the .nupkg file with me which is generated after building the project.
Now I want to generate a plugin for sonar. So when I run the generator tool by following command:
RoslynSonarQubePluginGenerator /a:AnalyzerExample.1.0.6971.18074.nupkg
I get the following error:
No packages with the specified id were found: AnalyzerExample.1.0.6971.18074.nupkg
I have tried putting the .nupkg file at different locations, as mentioned in the following post: https://github.com/SonarSource/sonarqube-roslyn-sdk#configuring-nuget-feeds
I have attached images, when I run Roslyn plugin generator.
Screenshot of the error
Upvotes: 2
Views: 413
Reputation: 1590
The parameter you are passing to the RoslynSonarQubePluginGenerator isn't quite right.
You just need to pass the id of your NuGet package to the generator, not the full name of the package file e.g.
RoslynSonarQubePluginGenerator /a:AnalyzerExample
If there are multiple versions of the package, the generator will use the latest released version. If you want to pick a specific version, add a colon and the version to the command line e.g.
RoslynSonarQubePluginGenerator /a:AnalyzerExample:1.0.6971.18074
Upvotes: 0