locked
Package vs. Addin RRS feed

  • Question

  • Hi,

     

    I'm wondering what kind of advantages, if any, a VS addin offers over a VS package.  It is my understanding that an addin primilary makes use of the DTE (although I know it can get at lower lever VS integration APIs as well), and that the VS package is meant for 'deeper' VS integration - for implementing things like editors and projet systems.

    The reason I ask is, I'm looking at how MS workflow 4 integrates with VS, and in particular some of the debugging support.  It seems like there is a package and addin that work together, and I'm trying to understand if there is any benefit/requirement to use both a package and an addin.

    Thanks,

    Notre

    Friday, June 3, 2011 7:51 PM

Answers

  • Hi Notre,

    The lines have blurred a bit over the years. I usually recommend an addin if the extension is somewhat trivial. Meaning, you simply want to have a quick way to add a menu item, or perhaps a toolwindow to the VS IDE. But if you're doing something like a custom designer, or want a more integrated scenario, a package is the way to go.

    I wasn't aware that the workflow stuff made use of an addin. Some packages use the DTE automation services, but they aren't addins per se. Just packages that leverage some of the automation services.

    The biggest difference is in how they are launched/loaded. You cannot properly proffer services from an addin (say an editor factory, project type, etc). And a package has load on demand support, with cached menus resources, so you dont' get the overhead of loading/running your package code until it's actually required.

    Sincerely,


    Ed Dore
    • Marked as answer by Notre Monday, June 6, 2011 4:45 PM
    Saturday, June 4, 2011 5:59 PM
  • Notre,

    The Addin you see with WF is not a VS Addin.  It is a Managed Addin Framework (MAF) addin.  The WF Designer integration with VS is done using a VS Package.  The WF Designer itself is loaded in a separate AppDomain using MAF.  I hope that helps.



    • Proposed as answer by B. Shyamsundar Tuesday, June 21, 2011 11:00 PM
    • Marked as answer by Notre Wednesday, June 22, 2011 1:08 AM
    Tuesday, June 21, 2011 10:58 PM

All replies

  • Hi Notre,

    The lines have blurred a bit over the years. I usually recommend an addin if the extension is somewhat trivial. Meaning, you simply want to have a quick way to add a menu item, or perhaps a toolwindow to the VS IDE. But if you're doing something like a custom designer, or want a more integrated scenario, a package is the way to go.

    I wasn't aware that the workflow stuff made use of an addin. Some packages use the DTE automation services, but they aren't addins per se. Just packages that leverage some of the automation services.

    The biggest difference is in how they are launched/loaded. You cannot properly proffer services from an addin (say an editor factory, project type, etc). And a package has load on demand support, with cached menus resources, so you dont' get the overhead of loading/running your package code until it's actually required.

    Sincerely,


    Ed Dore
    • Marked as answer by Notre Monday, June 6, 2011 4:45 PM
    Saturday, June 4, 2011 5:59 PM
  • Hi Ed,

     

    Thanks for that explanation.  That's how I thought someone would choose between an addin and package, so I appreciate the confirmation.

     

    Yes, the workflow stuff appears to have both a package and an addin - Microsoft.VisualStudio.Activities.dll (contains the package) and Microsoft.VisualStudio.Activities.Addin.dll (contains the addin).  Why workflow use both a package and an addin is a mystery to me, so I guess I'll have to ask in the workflow forum.

     

    Thanks for your help!

    Notre

    Monday, June 6, 2011 4:45 PM
  • Notre,

    The Addin you see with WF is not a VS Addin.  It is a Managed Addin Framework (MAF) addin.  The WF Designer integration with VS is done using a VS Package.  The WF Designer itself is loaded in a separate AppDomain using MAF.  I hope that helps.



    • Proposed as answer by B. Shyamsundar Tuesday, June 21, 2011 11:00 PM
    • Marked as answer by Notre Wednesday, June 22, 2011 1:08 AM
    Tuesday, June 21, 2011 10:58 PM
  • That does help clarify things a bit.  Thank you for that.  Is the advantage of the MAF addin that it is loading in a seperate AppDomain or is there more to it than that?

     

    Notre

    Wednesday, June 22, 2011 1:08 AM