Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
506 views
in Technique[技术] by (71.8m points)

.net - 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:

  • GAC can't handle multiple versions of the same assembly, and so won't allow me to install a newer version.

  • Somehow I don't fulfil the requirements. These are basically XPsp2, and .Net 1.1 or above, both of which I have. The requirements section also mentions, that the download works with office 2007, which I don't have installed, but I don't think this is a requirement. This is both because is isn't specified as a requirement, but also because Hans Passant in a comment to my original question was very sure that the PIAs could specifically be used for developing without Office being installed, so it would not make sense to have Office as a prerequisite.

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.0Visual Studio Tools for OfficePIAOffice14

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...