How to get the application object using VS 2010 Extensibility


  • Hi,

    So, I am trying to convert a VS add-in to the extensibility programming model (creating VS packages).

    My problem is that in my add-in I could get a reference to the executing application (i.e. the running VS solution) by accessing the "application" parameter in the OnConnection method:


    public void OnConnection(object application, ext_ConnectMode ... 
     DTE2 app = (DTE2)application;
    When using the extensibility programming model I don't have this ("stuff" is done in Initialize). So my question is how I can get hold of this. Or rather, I would like to know the active solution and project - which I can get from the DTE2 instance. Is there a "smart" way to do this using extensibility (VS Package)? 

   | @nielsberglund
    Wednesday, July 27, 2011 12:04 PM


All replies