Why use the PIAs?

A

Andy Stevens

I'm developing a Word addin using .Net

This is probably a ridiculous question and as such feel free to ridicule me.
Could someone explain why I should use the Office PIAs? They're such a
nightmare to deploy, and the documentation seems to contradict itself all
over the place.

The documentation for creating a basic shared addin just declares the
application as object and works fine.

What's wrong with declaring everything as object and abandoning the PIAs
completely?

Regards,

Andy
 
P

Patrick Smith [MSFT]

This is a fine question.

The PIA is the official signed representation of the underlying type
library. Even if you choose not to use the PIA, when you add the reference
to your project, an IA will be generated which is much like the PIA except
it will live in your local directory (not in the GAC) and would be unsigned.

The easiest way to define why a PIA is preferable is to copy/paste from
MSDN:

snip
PIAs are important because they provide unique type identity. The PIA
distinguishes the official type definitions from counterfeit definitions
provided by other interop assemblies. Having a single type identity ensures
type compatibility between applications that share the types defined in the
PIA. Because the PIA is signed by its publisher and labeled with the
PrimaryInteropAssembly attribute, it can be differentiated from other
interop assemblies that define the same types.
snip

If you want to read more info about PIA's in general, the above text was
copied from:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndotnet/html/whypriinterop.asp

Regarding your painful to deply scenario, we are making the PIA's available
in the form of a redist just like we did with Office 2003. This should help
somewhat, but of course, .NET Framework must be available on the machine at
install time or else the PIA's won't work. Also, another change in Office
2007 is that the PIA's will be installed by default. This should narrow the
scenarios where you much install the PIA's for your deployment, although
because of the .NET Framework requirement at install time, it won't
eliminate it completely.

Hope this helps,
 
K

Ken Slovak - [MVP - Outlook]

Also, in the case the poster mentions wouldn't that prevent all event
handling if the objects are declared as late bound Object types?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top