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

All ServiceLocator calls that retrieve MEF services should avoid the UI thread. #11201

Closed
nkolev92 opened this issue Aug 30, 2021 · 3 comments · Fixed by NuGet/NuGet.Client#4229 or NuGet/NuGet.Client#4244
Assignees
Labels
Category:Quality Week Issues that should be considered for quality week Priority:2 Issues for the current backlog. Product:VS.Client Tenet:Performance Performance issues Type:Bug

Comments

@nkolev92
Copy link
Member

Avoid using methods that access the UI thread when request services exposed via MEF. Use free threaded calls, or ideally uses MEF composition.

This means adding a new public method in ServiceLocator

@nkolev92 nkolev92 added Priority:2 Issues for the current backlog. Product:VS.Client Tenet:Performance Performance issues Type:Bug labels Aug 30, 2021
@nkolev92
Copy link
Member Author

Note that this issue means reviewing methods such as:

GetInstance, GetInstanceAsync, GetInstanceSafe

@nkolev92
Copy link
Member Author

nkolev92 commented Sep 3, 2021

NuGet/NuGet.Client#4229 seems like it has a regression, not sure why.

@nkolev92
Copy link
Member Author

nkolev92 commented Sep 3, 2021

Actually I know why :D

The PackageSourceProvider is probably not set early enough, because it's set during the package initialization, so getting the SComponentModel likely returns null, because it used to default to return Package.GetGlobalService(typeof(TService)) as TInterface; but now it doesn't.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category:Quality Week Issues that should be considered for quality week Priority:2 Issues for the current backlog. Product:VS.Client Tenet:Performance Performance issues Type:Bug
Projects
None yet
1 participant