I need to use cross-appdomain calls in my app, and sometimes I have this RemotingException:
Object \'/2fa53226_da41_42ba_b185_ec7d9c454712/ygiw+xfegmk
This happened for us because we had a static variable in one of our classes that was of type AppDomain. The class was used in a long running windows service. AppDomain has a InitializeLifetimeService method that needs to be overridden like this:
public override object InitializeLifetimeService(){
return null;
}
We were constantly using this as the private variable that loaded and unloaded some dlls for custom built outside logic. The answer has been taken from here: msdn answer
Because we were not able to change this at production time, we ended with a compromise of restarting the windows service at random intervals that are shorter than the lifetime of the static AppDomain variable which by trial and error we found that it is several days.
This question also helped clarify some things about lifetime: stackoverflow-question