private void AddTaskSchedulerService() { // Force its singleton instance property, used by VsTaskSchedulerService, to be set var package = new Microsoft.VisualStudio.Services.TaskSchedulerPackage(); ((IVsPackage)package).SetSite(this); // This ctor calls other services from the ServiceProvider, so it must be added after initialization. // VsIdleTimeScheduler uses VsShell.ShellPropertyChanged to wait for an OleComponentManager to exist, // then calls FRegisterComponent(). I don't know how to implement that, so my VsShell will not raise // event, leaving it in limbo. This means that idle processing won't work; I don't know where that's // used. // Used by JoinableTaskFactory AddService(typeof(SVsTaskSchedulerService), Activator.CreateInstance(typeof(VsMenu).Assembly.GetType("Microsoft.VisualStudio.Services.VsTaskSchedulerService"))); }