wpf 无法加载文件或程序集“Microsoft.Office.Interop.Outlook,版本=12.0.0.0,文化=中性,PublicKeyToken=71e9bce111e9429c

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/19346125/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-13 09:50:29  来源:igfitidea点击:

Could not load file or assembly 'Microsoft.Office.Interop.Outlook, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c

c#.netwpf

提问by Danny

I have a vs2010 wpf application that is connecting to outlook.

我有一个连接到 Outlook 的 vs2010 wpf 应用程序。

My pc is windows 7 64bit with office 2003, one of my target pc is xp 32 bit also with office 2003.

我的电脑是带有 office 2003 的 windows 7 64 位,我的目标电脑之一是带有 office 2003 的 xp 32 位。

I tried to update the version in the target pc and one of the application feature is to choose outlook folder, when i am trying to choose a folder from the outlook i am getting this exception :

我尝试更新目标 PC 中的版本,应用程序功能之一是选择 Outlook 文件夹,当我尝试从 Outlook 中选择文件夹时,出现此异常:

Could not load file or assembly 'Microsoft.Office.Interop.Outlook, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c'

无法加载文件或程序集“Microsoft.Office.Interop.Outlook,版本=12.0.0.0,Culture=neutral,PublicKeyToken=71e9bce111e9429c”

Thanks

谢谢

Danny

丹尼

回答by aL3891

On your dev machine you've added a reference to the wrong version of the office dlls. Try removing the reference to Microsoft.Office.Interop.Outlook and add it back again, but when you do, verify what version you're adding, there will likely be multiple ones. Version 12 is office 2007 and version 11 is 2003 I believe.

在您的开发机器上,您添加了对错误版本的 office dll 的引用。尝试删除对 Microsoft.Office.Interop.Outlook 的引用并将其重新添加回来,但是当您这样做时,请验证您添加的是哪个版本,可能会有多个版本。我相信版本 12 是 Office 2007,版本 11 是 2003。