Outlook Addin 中的远程处理服务器托管
我正在使用 C# 2.0 开发一个软件,它有一个 Windows 应用程序和一个 Outlook 插件。对于 IPC,我使用带有二进制格式化程序的远程处理。这两个组件都有对公共项目“Core”的引用,其中包含与远程处理相关的类定义。我的外接程序是服务器,即注册远程对象。
现在的问题是,当我的 Windows 应用程序尝试调用远程方法时,我收到一个异常,它找不到该“核心”库。以下是我收到的异常的一部分。
=== Pre-bind state information ===
LOG: User = rakib-bd\rakib
LOG: DisplayName = Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
(Fully-specified)
LOG: Appbase = file:///C:/Program Files/Microsoft Office/Office12/
LOG: Initial PrivatePath = NULL
Calling assembly : (Unknown).
据我了解,它需要 Office 安装目录中的 Core.dll。但它在我的软件的安装目录中,我的 Outlook 加载项的 dll 也在我的软件的安装目录中。
现在我的问题是,如何更改它以便它在我的软件安装目录中查找 Core.dll。
谢谢你,
拉基布·哈桑
I am developing a software using C# 2.0 that has an windows application and an Outlook Add-In. For IPC, I am using Remoting with Binary formatter. Both component has a reference to a common project "Core" which contains Remoting related class definitions. My add-in is the server i.e. registers the remote object.
Now, the problem is, when my windows application tries to call the remote method, i am getting an exception that it cannot find that "Core" library. Following is a portion of the exception that i am getting.
=== Pre-bind state information ===
LOG: User = rakib-bd\rakib
LOG: DisplayName = Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
(Fully-specified)
LOG: Appbase = file:///C:/Program Files/Microsoft Office/Office12/
LOG: Initial PrivatePath = NULL
Calling assembly : (Unknown).
As I understand, it is expecting the Core.dll in the office installation directory. But it is in my software's installation directory, so is the dll of my Outlook add-in.
Now my question is, how can I change this so that it looks for the Core.dll in my software's installation directory.
Thanking you,
Rakib Hasan
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要处理
AppDomain.CurrentDomain.AssemblyResolve
并使用
Assembly.LoadFile< 加载程序集/代码>
。
You need to handle
AppDomain.CurrentDomain.AssemblyResolve
and load the assembly usingAssembly.LoadFile
.