title: Visual Studio VSIX OnSolutionOpened not working
body: <p>I'm trying to implement some sort of Start Page Extension for Visual Studio. The main purpose would be to put Instructions and Best Practices for specific projects within the company I work for by launching an local HTML file every time a solution is opened. I started by using the Visual Commander (<a href="https://vlasovstudio.com/visual-commander/extensions.html" rel="nofollow noreferrer">https://vlasovstudio.com/visual-commander/extensions.html</a>) which worked perfectly. But I wanted to make it a VSIX file instead. After some research I generated the code but if I debug or directly install the vsix from the debug folder nothing happens (not even if I throw an exception on the first line). The code is pretty simple:</p>
  
  <pre><code> #region Package Members
  
      DTE DTE;
  
      /// &lt;summary&gt;
      /// Initialization of the package; this method is called right after the package is sited, so this is the place
      /// where you can put all the initialization code that rely on services provided by VisualStudio.
      /// &lt;/summary&gt;
      protected override void Initialize()
      {
          base.Initialize();
          try
          {
              IServiceContainer serviceContainer = this as IServiceContainer;
              DTE = serviceContainer.GetService(typeof(SDTE)) as DTE;
              EnvDTE.Events events = DTE.Events;
              EnvDTE.SolutionEvents solutionEvents = events.SolutionEvents;
              solutionEvents.Opened += OnSolutionOpened;
          }
          catch (Exception ex)
          {
              throw ex;
          }
      }
  
      private void OnSolutionOpened()
      {
          try
          {
              string startupFile = System.IO.Path.Combine(System.IO.Path.GetDirectoryName(DTE.Solution.FullName), GetSolutionStartPage());
              if (System.IO.File.Exists(startupFile))
              {
                  DTE.ItemOperations.Navigate(startupFile);
              }
          }
          catch (Exception ex)
          {
              throw ex;
          }
      }
  
      string GetSolutionStartPage()
      {
          return ((DTE.Solution != null) ? System.IO.Path.GetFileNameWithoutExtension(DTE.Solution.FullName) : "") + ".html";
      }
  
      #endregion
  </code></pre>