Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to install or update NuGet package in Visual Studio 2022 #5334

Closed
dougwaldron opened this issue Jan 27, 2022 · 3 comments · Fixed by #5335
Closed

Unable to install or update NuGet package in Visual Studio 2022 #5334

dougwaldron opened this issue Jan 27, 2022 · 3 comments · Fixed by #5335
Assignees
Labels
Area: C# C# rules related issues. Area: VB.NET VB.NET rules related issues. Type: Bug Exceptions and blocking issues during analysis.
Milestone

Comments

@dougwaldron
Copy link

Trying to install or update the SonarAnalyzer.VisualBasic NuGet package fails in Visual Studio 2022. The error message displayed is "This package can only be installed on Visual Studio 2015 Update 3 or later." I assume the same error would occur for the SonarAnalyzer.CSharp package.

I can update the package by directly editing the "packages.config" file.

The problem seems to be these lines in install.ps1:

if ('14.0', '15.0', '16.0' -notcontains $project.DTE.Version) {
    $invalidVsVersion = $true
}

Visual Studio 2022 is version 17!

@pavel-mikula-sonarsource
Copy link
Contributor

Hi @dougwaldron,

Thank you for catching and reporting this.

I can reproduce it when adding package to .NET Fx project, it doesn't reproduce for .NET Core project.

@dougwaldron
Copy link
Author

Thanks for the quick fix!

@costin-zaharia-sonarsource
Copy link
Member

Thanks, @dougwaldron for providing the feedback. We plan to do a release on Monday and this fix will be included.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: C# C# rules related issues. Area: VB.NET VB.NET rules related issues. Type: Bug Exceptions and blocking issues during analysis.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants