public Assembly TypeResolve(object sender, ResolveEventArgs args)
static void Main(string args)
AppDomain myDomain = AppDomain.CreateDomain("myDomain", null, AppDomain.CurrentDomain.BaseDirectory, "", false);
Handler handler = new Handler();
myDomain.TypeResolve += new ResolveEventHandler(handler.TypeResolve);
The answer becomes obvious if you add the line
after the creation of the AppDomain.
The delegate that is passed into the event handler needs to be remoted, and there will be serialization exception when marshaling the instance of Handler as it is not attributed as Serializable. When a colleague came up to me and said he had an event handler that worked when the handler method was static, but not when the handler was an instance method, I was sceptical, but he was proved right in the end.