本文介绍了为什么不办公PIA正确安装到GAC?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前工作的一个C#项目,我需要访问Outlook。的开发正在做在两个不同的机器上,其中的一个已安装的办公室,以及其中一个没有。我$p$pviously问如何编译我的项目对前景COM对象,以及评论的一个建议,我对编制办公室主互操作程序集或PIA。在我下载的<一个href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=59daebaa-bed4-4282-a28c-b864d8bfa513&DisplayLang=en">Office 2007年PIA ,有一个msi文件,是应该安装一些初步评估的办公室的不同部分。我的问题是,这个看似不会发生。在我的办公室少机,输入后

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

在提示符下,在Windows安装程序启动,与显示请稍候Windows配置Microsoft Office 2007的主互操作程序集。收集所需信息以及一个进度条在33%左右,之后消失的消息框,而在此之后

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

产生任何结果的Office 2007(我得到的结果,这是版本10.0.4504.0,是以前安装的尝试与错误的Office版本的结果,但Office 2007的PIA的有重大的12版。)

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无法处理多个版本的同一程序集的,所以不会让我安装新版本。

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

不知怎的,我不履行<一href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=59daebaa-bed4-4282-a28c-b864d8bfa513&DisplayLang=en#SystemRequirements">requirements.这些基本上是XPSP2和.Net 1.1或以上,这两者我有。要求部分还提到,该下载适用于Office 2007的,我没有安装,但我不认为这是一个要求。这既是因为没有指定作为一项要求,也是因为汉斯​​帕桑特在注释的很肯定正在安装的PIA的可以专门用于开发没有办公室,所以它是没有意义有办公室为prerequisite。

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.

因此​​,没有人有任何想法,为什么Office 2007的PIA的不正确安装,或有什么我可以做更接近答案?如果您需要了解更多信息,请让我知道。谢谢你。

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.

推荐答案

我前一阵子打这个,用一个类似的项目。在PIA可再发行将只安装PIA的,如果已安装在计算机上的Office(哪一种是有道理的,但也可以是恼人的,当涉及到部署)

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中应安装Office PIA的到一个文件夹下,它自己的安装目录 - 例如,我的机器上我所有的PIA的下一个副本:

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

这可能是因为这些只能获得安装,如果你VS安装,或者可能有一个在VS安装程序安装选项安装VSTO(Visual Studio工具用于Office)。您的计算机上安装Office的时候

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).

如果您的问题只是涉及到越来越构建工作在开发计算机上没有安装Office,那么你可以尝试重新运行安装程序VS,看看你安装VSTO的选项,或者尝试一个谷歌搜索,看看是否有一个单独的VSTO下载

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

否则,我只想在PIA的,从这个文件夹复制到其他开发中类似的位置。

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

这篇关于为什么不办公PIA正确安装到GAC?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-22 20:42
查看更多