SonarLint not supported on Visual Studio 2015

sonarlint
sonarqube

(Elavarasan Chidambaram) #1

Hello,

I got to know that SonarLint also supports Visual Studio 2015. But I am getting an error when i tried to install SonarLint on VS 2015 Enterprise. I have Visual Studio 2015 Enterprise Update 3. The machine where Visual Studio is installed doesn’t have internet access. I believe there shouldn’t be any issue as i am installing offline installer? Copying the error log below. Please help. Thanks.

9/11/2018 9:10:47 AM - References :
9/11/2018 9:10:47 AM - Signature Details…
9/11/2018 9:10:47 AM - Extension is signed with an invalid certificate
9/11/2018 9:10:47 AM - (PartialChain) : A certificate chain could not be built to a trusted root authority.
9/11/2018 9:10:47 AM - (RevocationStatusUnknown): The revocation function was unable to check revocation for the certificate.
9/11/2018 9:10:47 AM - (OfflineRevocation) : The revocation function was unable to check revocation because the revocation server was offline.
9/11/2018 9:10:47 AM -
9/11/2018 9:10:47 AM -
9/11/2018 9:10:47 AM - Searching for applicable products…
9/11/2018 9:10:47 AM - Found installed product - Microsoft Visual Studio Enterprise 2015
9/11/2018 9:10:47 AM - Found installed product - Microsoft Visual Studio Professional 2015
9/11/2018 9:10:47 AM - Found installed product - Microsoft Visual Studio Community 2015
9/11/2018 9:10:47 AM - Found installed product - Microsoft Visual Studio 2015 Shell (Integrated)
9/11/2018 9:10:47 AM - Found installed product - Global Location
9/11/2018 9:10:47 AM - VSIXInstaller.NoApplicableSKUsException: This extension is not installable on any currently installed products.
at VSIXInstaller.App.InitializeInstall(Boolean isRepairSupported)
at VSIXInstaller.App.InitializeInstall()
at System.Threading.Tasks.Task.InnerInvoke()
at System.Threading.Tasks.Task.Execute()


(Konstantin) #2

Hello,

I also tried SonarLint in VS 2015. I installed it via “Extensions and Updates”.
It requires to install additional component via NuGet package manager - SonarAnalyzer.CSharp. This step is not documented on the official site. Then it works.
But I got strange warning CA0064 “No analysis was performed because the specified rule set could not be loaded or did not contain any managed code analysis rules.” However SonarLint could find some number of issues.


(Valeri Hristov) #3

Hi @elavarasan16, could you please send me the version of your Visual Studio 2015? The minimum supported version of SonarLint for VS2015 is 14.0.25420.00. Other than that it does not have any prerequisites apart from .NET Framework 4.6 and should install fine on VS2015 Enterprise (I am using it right now).


(Valeri Hristov) #4

@piligrim, the SonarAnalyzer.CSharp nuget is installed only when you bind a project to a SonarQube instance. You should be able to install SonarLint using the VSIX without Internet access.


(Elavarasan Chidambaram) #5

Hi @Val Thanks for looking into this problem. I am also using VS 2015 Enterprise Update 3. I have attached the screenshot for reference. Please let me know if anything else is required. Thanks.


(Elavarasan Chidambaram) #6

@piligrim, Hi I am trying to install offline version as my server doesn’t have internet connectivity. Thanks.


(Duncan Pocklington) #7

Hi @elavarasan16.
Have a look at this post on StackOverflow about installing extensions offline. It suggests that the VSIX installer is blocking the installation because it cannot validate the certificate.

Are you able to trying installing the same file on a connected machine to check whether this is the case?


(Konstantin) #8

Hello,

Thank you for clarification. When I tried to work offline I had only warning CA0064 “No analysis was performed because the specified rule set could not be loaded or did not contain any managed code analysis rules.”

Could you help me how to resolve it?

Best regards,
Konstantin


(Elavarasan Chidambaram) #9

Hi @duncanp

Thanks for the help. I have tried installing the offline installer on a connected machine and i am getting the same error. I extracted the Visual studio installer and looked into extension.vsixmanifest file. Under <Installation>, i see only Community edition. Could that be the issue? Should we add Enterprise here? will it help? Please check.

 <Installation>
    <InstallationTarget Id="Microsoft.VisualStudio.Community" Version="[15.0,16.0)" />
  </Installation>

(Duncan Pocklington) #10

Hi @elavarasan16,

The manifest only needs to specify the lowest level SKU - all higher levels SKUs are automatically supported. So there’s no need to specify Enterprise specifically.

However, the version specification in the manifest is for VS2017, not VS2015. There are separate installers for SonarLint for VS2015 and VS2015, with separate entries in the Visual Studio Marketplace (SonarLint for VS2015 and SonarLint for VS2017).

Could you check that you are definitely running the VS2015 installer please? The file name for the VSIX will end with either -2015.vsix or -2017.vsix, depending on the version.


(Elavarasan Chidambaram) #11

Hi @duncanp,

I was caught up with other priorities and couldn’t check this last week. My bad! I didn’t know that there is a seperate extension for VS2015. I downloaded and installed it on VS 2015 Enterprise. It works like a charm! Thanks a lot for the help.

I have a suggestion regarding hardcoded values for C#.net There are few rules which capture hardcoded configs such as ip, credentials and URL/URIs. But it doesn’t cover db connection string without credentials, hostname and etc. Hardcoded config can be mistakenly written in any format. It would be great if Sonar could fine-tune or add more rules. Thanks.