How do register PIA12 (Office 2007) assemblies with visual studio 2013

1.8k views Asked by At

I installed Office 2013 and VS2013 on Windows 8.1 - when I now open old Projects which reference the version 12 PIAs (for Office 2007) these are missing in the references since VS2013 does only install Version 14 and 15 of the PIAs.

Since I want to Keep using PIA 12 I do not want to change the references. Instead I'd like to Register the Version 12 PIA's with VS2013. How can I achieve this?

I already tried using the PIA redistributable, but it does not want to work unless I install Office 2007, too (which I don't want). I can get a copy of the dlls from some other system, but how do I register These with Visual Studio 2013 (I don't need them in the GAC, I think, just in VS2013).

As far as I know for the PIA some COM class ID's should be recorded, I just don't know how/which.

Edit:

Right now the PIA dlls are referenced just by Name and Fingerprint/public key (no hint path). When I open the reference Panel in VS2013 they will Show up, can be selected and work. They seem to be registered somewhere so VS2013 can find them. I just want to replicate this on other Computers.

1

There are 1 answers

9
Hans Passant On

I've got the exact same setup, a machine with Windows 8.1 and only Office 2013 installed. No trouble at all getting the Office 2007 PIAs installed. Do beware that this is a two-step process. After you downloaded PrimaryInteropAssembly.exe from the Microsoft server and started it, you prompts you to give a directory to store intermediate files. Navigate to that directory, right-click the o2007pia.msi file and select Install to get them actually registered.

It isn't the only way to get them onto your machine. If you have another machine with the PIAs installed then create a dummy project and add the references to the Microsoft.Interop assemblies you need. Select them and ensure that the "Embed Interop Types" property is set to False and the "Copy Local" property is set to True. Build the project, you'll get the interop assemblies in the bin\Debug directory. Copy them to your machine and use the Browse button to add a reference to them. You always want the "Embed Interop Types" property set to True in your real project so you don't have to deploy the PIA on your user's machine anymore. Check them in with your project so you don't lose them again.


UPDATE: PIAs are obsolete since .NET 4.0 and VS2010. Check this post for the details.