I have a problem, which I realy can't get behind. I have two programms, the communicate throu IPC using BinaryFormatting. I placed the client- and server-class in the same assembly including all classes to transport data.
What I don't understand is why I'm getting a serialization exception with "Assembly not found" when I'm trying to recive an object but sending one works perfect.
So if the IPC client calls a method "Config GetConfig()" that returns my config-class the exception is thrown. When I call a mehtod "SetConfig(Config config)" the config arrives at the IPC-server without any problem.
I've already tried to switch to SoapFormatter instead of Binary and tried working with interface instead of the class. All with the same result. Sending data works fine, getting Data throws the desirialization exception.
Can somebody give me a hint, how I can fix this issue? Or at least what to look for to fix it?
so some time after asking the question I finally found the problem and the solution. Problem was, that my client is part of a COM-Component and a post directed me the way, that the binaryformatter doesnt care about already loaded assemblies. It looks like it always tries to resolve the assembly from the AppDomain.CurrentDomain.BaseDirectory which is the path of the executable in my case it's outlook.
So the solution was to bind to the AssemblyResolve-Event in the appdomain an resolve the assembly from the correct directory.
Hope this helps if somebody else has the same problems.