Kelvysb_SBExplorer/SBExplorer/SBExplorerPackage.cs
using Community.VisualStudio.Toolkit;
using Microsoft.VisualStudio.Shell;
using Microsoft.VisualStudio.Shell.Interop;
using SBExplorer.Services;
using System;
using System.Runtime.InteropServices;
using System.Threading;
using Task = System.Threading.Tasks.Task;

namespace SBExplorer
{
    [PackageRegistration(UseManagedResourcesOnly = true, AllowsBackgroundLoading = true)]
    [InstalledProductRegistration(Vsix.Name, Vsix.Description, Vsix.Version)]
    [ProvideToolWindow(typeof(ServiceBusExplorer.Pane), Style = VsDockStyle.Tabbed, Window = WindowGuids.SolutionExplorer)]
    [ProvideMenuResource("Menus.ctmenu", 1)]
    [Guid(PackageGuids.SBExplorerString)]
    public sealed class SBExplorerPackage : ToolkitPackage
    {
        protected override async Task InitializeAsync(CancellationToken cancellationToken, IProgress<ServiceProgressData> progress)
        {
            await JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken);
            var solutionService = (SVsSolution)await GetServiceAsync(typeof(SVsSolution));
            var solutionInterface = solutionService as IVsSolution;
            ServiceBusExplorerService.Initialize(solutionInterface);
            await this.RegisterCommandsAsync();
            this.RegisterToolWindows();
        }
    }
}
