Eliminate ServiceProvider as dangerous coding pattern (which can cause hangs) #4268

Closed
alpaix opened this Issue Jan 12, 2017 · 0 comments

Comments

Projects
None yet
3 participants
@alpaix

alpaix commented Jan 12, 2017

Eliminate usage of the ServiceProvider across the entire code base as potentially dangerous coding pattern leading to deadlock scenarios in VS.

A developer should be aware of the method requested service is imported be it MEF, or VS global service, rather than rely on some a "magical" utility to do the resolving.

alpaix added a commit to alpaix/NuGet.Client that referenced this issue Jan 13, 2017

Remove ServiceLocator calls from MEF ctors
Addresses NuGet/Home#4268.
Follow-up on #1120.

Cleanup pass over MEF types to remove all `ServiceLocator` calls from
constructors to avoid switching to UI thread during instantiation.

alpaix added a commit to alpaix/NuGet.Client that referenced this issue Jan 14, 2017

Remove ServiceLocator calls from MEF ctors
Addresses NuGet/Home#4268.
Follow-up on #1120.

Cleanup pass over MEF types to remove all `ServiceLocator` calls from
constructors to avoid switching to UI thread during instantiation.

@alpaix alpaix referenced this issue in NuGet/NuGet.Client Jan 14, 2017

Merged

Remove ServiceLocator calls from MEF ctors #1124

@rrelyea rrelyea added this to the 4.0 RTM milestone Jan 14, 2017

@rrelyea rrelyea added the Priority:1 label Jan 14, 2017

alpaix added a commit to alpaix/NuGet.Client that referenced this issue Jan 18, 2017

Remove ServiceLocator calls from MEF ctors
Addresses NuGet/Home#4268.
Follow-up on #1120.

Cleanup pass over MEF types to remove all `ServiceLocator` calls from
constructors to avoid switching to UI thread during instantiation.

@rrelyea rrelyea changed the title from Eliminate ServiceProvider as dangerous coding pattern to Eliminate ServiceProvider as dangerous coding pattern (which can cause hangs) Jan 19, 2017

@rrelyea rrelyea closed this Jan 24, 2017

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