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

[Bug]: Avoid explicitly casting the result of GetService/GetServiceAsync, use the extension methods instead #11451

Closed
kartheekp-ms opened this issue Dec 12, 2021 · 2 comments · Fixed by NuGet/NuGet.Client#4368
Assignees

Comments

@kartheekp-ms
Copy link
Contributor

kartheekp-ms commented Dec 12, 2021

NuGet Product Used

Visual Studio Package Management UI, Visual Studio Package Manager Console

Product Version

VS

Worked before?

No response

Impact

No response

Repro Steps & Context

Address https://github.com/NuGet/NuGet.Client/pull/4324/files#r737866598 comment.

Verbose Logs

No response

@nkolev92
Copy link
Member

Weird, that API has slipped through the APi banning I added in NuGet/NuGet.Client@927e225.

https://github.com/NuGet/NuGet.Client/blob/dev/build/BannedSymbols.txt#L17

AsyncPackage seems to explicitly declare that method too, which means there is no extension method we can use directly.

Given that AsyncPackage impls the service provider, we should make sure we're calling it on the interface.

@nkolev92
Copy link
Member

We should ofc ban the AsyncPackage version of GetServiceAsync.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants