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

Roslyn Analyzer suggestion "install with package manager" opens NuGet to wrong tab #10124

Closed
vsfeedback opened this issue Oct 14, 2020 · 7 comments · Fixed by NuGet/NuGet.Client#4277
Assignees
Labels
Functionality:SDK The NuGet client packages published to nuget.org Functionality:VisualStudioUI Partner:Roslyn Priority:1 High priority issues that must be resolved in the current sprint. Product:VS.Client Type:Bug

Comments

@vsfeedback
Copy link

vsfeedback commented Oct 14, 2020

This issue has been moved from a ticket on Developer Community / https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1230203.


When editing my .NET app if a Roslyn analyzer appears with a helpful suggestion that the code I am attempting to write is not possible because I am missing a package and gives me a helpful suggestion to "install with package manager" it then tries to open NuGet manager.

This is where I hit a problem that I could reproduce easily. If the last time I used package manager I left my tab on for example "installed" it would be the tab that the analyzer would open and try to search for the missing package. This would show no results.

But obviously it should have switched to "Browser" since the package was not in my solution.


Original Comments

Feedback Bot on 10/14/2020, 03:31 AM:

We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.

Feedback Bot on 10/14/2020, 01:04 PM:

Thanks for creating this issue! We figured it’s covering the same as another one we already have. Thus, we closed this one as a duplicate. We’ve transferred all votes from this ticket to the other one. For more information, see also our issue reporting guidelines.

Happy coding!

kapenaga [MSFT] on 10/14/2020, 02:05 PM:

This issue is currently being investigated and could be because of another one we already have. Our team will get back to you if either more information is needed, a workaround is available, or the issue is resolved.


Original Solutions

(no solutions)

@kartheekp-ms
Copy link
Contributor

Repro steps

  1. Created .NET Core Console App
  2. Installed StyleCop.Analyzers package to the project.
  3. Type JObject in Program.cs file
  4. Click on Install Package Newtonsoft.json > Install with package manager..
  5. Navigated to PM UI installed tab with Newtonsoft.Json in search box.

1
issue

This could be because of another issue we already have.

@donnie-msft
Copy link
Contributor

We don't own this menu. I believe Roslyn owns it
https://github.com/dotnet/roslyn/blob/master/src/Features/Core/Portable/AddImport/CodeActions/InstallWithPackageManagerCodeAction.cs

I don't believe the #7309 issue is quite the same. It focuses on VS defaults.
Basically, Roslyn should be able to pass an argument to us. Perhaps it always depended on the last closed tab to be Browse... and that's bad.

@kartheekp-ms
Copy link
Contributor

Assigned feedback ticket to Roslyn team as per @donnie-msft comment.

@donnie-msft donnie-msft reopened this Oct 15, 2020
@donnie-msft donnie-msft added Type:Bug Functionality:SDK The NuGet client packages published to nuget.org labels Oct 15, 2020
@donnie-msft
Copy link
Contributor

Putting this back on our side.
Roslyn's PackageInstallerServiceFactory.ShowManagePackagesDialog calls IVsSearchProvider.CreateSearch.

The search API invokes our NuGetPackageManagerControlSearchTask.Start(). I believe we need to automatically set the current tab to Browse here, since the Search API generally assumes it's "Browsing" packages.

Future improvement would be to allow an API parameter to specify which tab to Search.

@donnie-msft donnie-msft added Priority:1 High priority issues that must be resolved in the current sprint. Pipeline:Backlog labels Oct 15, 2020
@donnie-msft donnie-msft changed the title Selecting "install with package manager" opens NuGet to wrong tab Roslyn Analyzer suggestion "install with package manager" opens NuGet to wrong tab Oct 15, 2020
@donnie-msft donnie-msft added this to Needs triage in VS PMUI Triage via automation Nov 3, 2020
@donnie-msft donnie-msft moved this from Needs triage to High priority in VS PMUI Triage Nov 3, 2020
@donnie-msft donnie-msft moved this from High priority to Ongoing in VS PMUI Triage Nov 14, 2020
@donnie-msft donnie-msft added Priority:2 Issues for the current backlog. and removed Priority:1 High priority issues that must be resolved in the current sprint. labels Jun 30, 2021
@donnie-msft donnie-msft moved this from Ongoing to Low priority in VS PMUI Triage Jun 30, 2021
@donnie-msft donnie-msft added Priority:1 High priority issues that must be resolved in the current sprint. and removed Priority:2 Issues for the current backlog. labels Jul 1, 2021
@donnie-msft
Copy link
Contributor

Adding a rough estimate. Haven't dug into it yet.

@donnie-msft donnie-msft added the Category:Quality Week Issues that should be considered for quality week label Jul 15, 2021
@donnie-msft donnie-msft self-assigned this Jul 15, 2021
@donnie-msft donnie-msft added this to the Sprint 2021-07 milestone Jul 15, 2021
@donnie-msft donnie-msft removed the Category:Quality Week Issues that should be considered for quality week label Sep 7, 2021
@aortiz-msft
Copy link
Contributor

Please try to fix opportunistically for 17.0; otherwise we will have to fix in 17.1

@donnie-msft
Copy link
Contributor

Released in VS 17.0.31729.192.

Also, a Roslyn fix no longer requires the package source be named exactly "nuget.org" to trigger this Codefix suggestion in VS.
dotnet/roslyn#56606

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Functionality:SDK The NuGet client packages published to nuget.org Functionality:VisualStudioUI Partner:Roslyn Priority:1 High priority issues that must be resolved in the current sprint. Product:VS.Client Type:Bug
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

4 participants