Delen via


PIAs and Version Compatibility

With the upcoming release of Visio 2007, I’ve had a number of questions recently about the .Net Primary Interop Assemblies (PIA) and how to make a managed COM add-in that works across different versions of Visio.

First, a brief history. If you have no idea what I am talking about, you can take a look at the following intro on MSDN: Primary Interop Assemblies and Interop Assemblies. I’ll be discussing Visio here but the story is pretty much the same for all of Office. PIAs were first introduced as a separate download after Visio 2002 shipped. Then, with the release of Visio 2003 the PIAs began to ship in the box and new ones will ship in Visio 2007.

Given all that, what does it mean for building apps that will work across versions. This is the basic story:

  • Apps written against the Visio 2002 PIAs are not compatible with either the Visio 2003 or 2007 ones.
  • Apps written against the Visio 2003 PIAs are forward compatible with Visio 2007.

If you want your application to work for Visio 2002 and forward, you will need to compile two different versions, one for Visio 2002 and one for Visio 2003/7. Then, set up your installer to detect the version of Visio that the user has installed and install the right version for that user.

Some more information on the PIAs:

Comments

  • Anonymous
    May 25, 2006
    It seems like such an unnecessary pain to have two separate installers (or branches in an installer), especially when the source code looks exactly the same.  I had VB6 code that supported everything from Visio 5 through Visio 2003 without recompilation, and I'm willing to bet that it would work with Visio 2007, too.  Why make it harder to program Office with .Net?

    Ah well, I suppose that it is water under the bridge.  I appreciate the effort to make 2003 PIA's forward-compatible.