12

I already developed a large Office application-level add-in and it works like a charm, but I have problems understanding the technical basis.

  1. So what exactly are VSTO and the PIAs good for?
  2. Does VSTO just provide a proper project type for Visual Studio and that's it?
  3. Are the Primary Interop Assemblies (PIA) just some kind of wrapper for accessing the Office Object Model?
  4. Do both of them provide more things and features than I am aware of?
Alexis Pigeon
  • 7,423
  • 11
  • 39
  • 44
alapeno
  • 2,724
  • 6
  • 36
  • 53

1 Answers1

11

VSTO is the application runtime that provides hooks (solution loader) into the Office subsystem via PIA. PIAs are wrappers around the unmanaged COM API (IDTExtensibility2) that Office is built from. PIAs provide managed access and run above the VSTO runtime.

VSTO comes with project types that build the deployment manifest required for detecting dependencies and loading your Add-In at runtime.

The PIAs provide managed access to the COM object-model, but it also supports unmanaged access should you want more control over how your solution is loaded (hence you always have VSTO runtime, but not always PIAs).

This MSDN link provides a great overview of the evolution of PIAs and VSTO away from IDtExtensibility2 which is another loading option (outside of PIAs)

SliverNinja - MSFT
  • 31,051
  • 11
  • 110
  • 173
  • @SilverNinja does VSTO require PIA installation? – JohnZaj Jul 23 '12 at 05:52
  • 1
    If you are using VSTO 2010 you don't need to install the PIAs. By default, the [interop types are embedded in your add-in assembly](http://msdn.microsoft.com/en-us/library/ee317478.aspx). You can toggle this behavior by changing the **Embed Interop Types** flag for each office assembly you include. – SliverNinja - MSFT Jul 23 '12 at 14:04
  • 1
    Thanks for confirming SilverNinja. I thought this was the case. I see the interops embedded in an add-in. I just need to make sure all other assemblies have the Embed Interop Types flag set. – JohnZaj Jul 28 '12 at 19:06
  • it is also worth pointing out that VSTO is an optional level above PIA (for those amongst us using VS Express editions), that makes things easier but is not necessary. :) – Cor_Blimey Sep 23 '12 at 19:50
  • Nice answer, but how to understand "PIAs provide managed access and run above the VSTO runtime" ? The VSTO uses PIA to communicate with the COM Objects in office – yorua007 Jun 01 '13 at 00:34