How to pass nuget package file path via cli when using sonarqube-roslyn-sdk

So, I am running the whole process of creating new rules and creating nuget package and then feeding it to sonarqube-roslyn-sdk via a powershell script so I don’t want to hard code nuget package path in nuget.config file instead I want to do it via cli. In github repo doc it is mentioned as “/customnugetrepo:file:///PathToRepo” but I am not able to implement it. can someone give a example of how to pass the path. Thanks

@Ketan_Mehra both of the following work for me:

RoslynSonarQubePluginGenerator.exe /a:wintellect.analyzers /customnugetrepo:file:///d:/localnugetfeed

RoslynSonarQubePluginGenerator.exe /a:wintellect.analzyers /customnugetrepo:d:\localnugetfeed\

Does it work if you execute the command directly from a command window rather than from a PowerShell script?

I am running below command like the way you mentioned and getting the same error

C:\Source\SonarQube.Roslyn.SDK-2.0>RoslynSonarQubePluginGenerator.exe /a:CustomAnalyzer /customnugetrepo:file:///C:/localnugetfeed
Roslyn Analyzer Plugin Generator for SonarQube 2.0.0.0
Maximum supported Roslyn version: 2.8.0.0
Minimum supported SonarQube version: 6.7 (highest version tested against: 7.3-alpha1)
Unrecognized command line argument: /customnugetrepo:file:///C:/localnugetfeed

C:\Source\SonarQube.Roslyn.SDK-2.0>RoslynSonarQubePluginGenerator.exe /a:CustomAnalyzer /customnugetrepo:c:\localnugetfeed
Roslyn Analyzer Plugin Generator for SonarQube 2.0.0.0
Maximum supported Roslyn version: 2.8.0.0
Minimum supported SonarQube version: 6.7 (highest version tested against: 7.3-alpha1)
*Unrecognized command line argument: /customnugetrepo:c:\localnugetfeed*

@Ketan_Mehra you are using v2 of the tool.

Try with v3.0.

it is working with V3.0, Thanks :slight_smile:

1 Like