.netwindows-xpcom-interopgacoffice-pia

Why doesn't the office PIA install correctly to the GAC?


I am currently working on a c# project, where I need to access Outlook. The development is being done on two different machines, one of which has office installed, and one of which doesn't. I previously asked how to compile my project against the outlook com object, and one of the comments suggested that I compiled against the office primary interop assembly, or PIA. In my downloaded Office 2007 PIA, there is an msi file, that is supposed to install a number of PIAs for the different parts of Office. My problem is that this seemingly doesn't happen. On my office-less machine, after typing

msiexec /i o2007pia.msi

at a prompt, the windows installer starts up, with a message box showing "Please wait while Windows configures Microsoft Office 2007 Primary Interop Assemblies. Gathering required information" along with a progress bar at about 33%, after which it disappears, and after which

gacutil -l microsoft.office.interop.outlook

yields no results for Office 2007 (I do get a result, which is versioned 10.0.4504.0 and is the result of an earlier installation attempt with a wrong Office version., but Office 2007 PIAs have major version 12.)

I see a couple of possible explanations, none of which I really believe in:

So does anyone have any idea why the Office 2007 PIAs do not install correctly, or what I could do to get closer to an answer? If you need more information, please let me know. Thanks.


Solution

  • I hit this a while ago, with a similar project. The PIA redistributable will only install the PIAs if Office is already installed on the machine (which kind of makes sense, but can be annoying when it comes to deployment)

    Visual Studio should install the Office PIAs into a folder under it's own install directory - for example, on my machine I have a copy of all the PIAs under:

    C:\Program Files (x86)\Microsoft Visual Studio 10.0\Visual Studio Tools for Office\PIA\Office14
    

    It's possible that these only get installed if you have Office on your machine at the time VS is installed, or perhaps there is an install option in the VS installer to install VSTO (Visual Studio Tools for Office).

    If your problem is just related to getting a build working on the development machine that doesn't have Office, then you could try re-running the VS installer and see if you get an option to install VSTO, or try a google search and see if there is a separate VSTO download

    Otherwise, I would just copy the PIAs from this folder to a similar location on the other Dev box.