protected override void Initialize() { base.Initialize(); AppDomain.CurrentDomain.AssemblyResolve += CurrentDomainAssemblyResolve; _solution = Services.GetService <SVsSolution, IVsSolution2>(); if (_solution != null) { _solution.AdviseSolutionEvents(this, out solutionEventsCookie).ThrowOnFailure(); } _dte = Services.GetService <DTE>(); _events = (Events2)_dte.Events; _buildEvents = _events.BuildEvents; _buildEvents.OnBuildBegin += OnBuildBegin; _buildEvents.OnBuildDone += OnBuildDone; new PackageCommands(this).AddCommands(); IconHost = VsStatusBarIconHost.CreateAndInjectIntoVsStatusBar(); Instance = this; TelemetryClient.Initialize(Constants.ProductVersion, _dte.Version, _dte.Edition); Logger.LogInfo("Initialized Package successfully."); }