views:

35

answers:

1

Hi,

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

+2  A: 

You need to handle AppDomain.CurrentDomain.AssemblyResolve and load the assembly using Assembly.LoadFile.

SLaks
Thanks a lot for your reply. I handled it in my Outlook add-in and it worked!!
Rakib Hasan