public static void CreateAndRegister(IServiceProvider serviceProvider) { var commandService = serviceProvider.GetService(typeof(IMenuCommandService)) as IMenuCommandService; Debug.Assert(commandService != null); if (commandService != null) { var omniBoxBroker = VSPackage.GetMefService <IOmniBoxUIService>(); Debug.Assert(omniBoxBroker != null); if (omniBoxBroker != null) { new ShellCommandTarget(commandService, omniBoxBroker); } } }