VSSDK-Analyzers icon indicating copy to clipboard operation
VSSDK-Analyzers copied to clipboard

Don't call GetService in Package constructors

Open AlexEyler opened this issue 6 years ago • 5 comments

Calling GetService in Package constructors is a common place for failures - there's no guarantee that the service provider will be properly set up by the time the Package is created.

Instead, the GetService call should be done in Initialize (or InitializeAsync, after switching to the main thread).

AlexEyler avatar Apr 12 '18 17:04 AlexEyler