Tincho
7/23/2004 2:16:00 PM
Hi,
I have an application (lets call it MyApp) that can run in
2 different modes.
As an add-in of another application (OtherApp) or it can
run by itself.
When it works as an add-in, it is created using a COM
component that opens the add-in in the other application.
One of the functionality it offers is to import some data
from another system and in order to do so it uses remoting
client to get some objects from remoting server.
The problem I'm getting is that when I call the remoting
function, I get this exception :
System.Runtime.Serialization.SerializationException: Cannot
find the assembly.
This happens only when it is used from OtherApp.
The missing assembly is in MyApp installation directory
(which is different from the OtherApp's one).
As far as I was able to debug, the problem is that when
called from inside OtherApp, the AppDomain.CurrentDomain
path is not the one where the dll is.
The installation directories cannot be changed (MyApp
installation directory cannot be inside OtherApp
installation directory), so as to add the other path using
AppendPrivatePath (using AppendPrivatePath with
"..\..\..\MyApp" is not working.
I also tried handling the
AppDomain.CurrentDomain.AssemblyResolve event, but it seems
as if it is never thrown.
Placing the dlls in the GAC is not acceptable either
(because of company policies).
Any ideas of how to fix it?
Thanks in advance.
Tincho