Hello there,
I built some assemblies, one of them is to provide some functionalities and some events. some relationship as below:
- Assembly A is one interface facade component, it declares all service interfaces.
- Assembly B is one "Mock" implementation of all interfaces declared Assembly A (include event)
- Assembly C is one "Real" implementation of all interfaces declared Assembly A (include event)
And B will be responsible for creating C in second AppDomain and invoke methods in C, like below: Inside B assembly:
void MethodA()
{
...
AppDomain proxyAppDomain = AppDomain.CreateDomain(..)
ProxyGenerator proxyGenerator = (ProxyGenerator)proxyAppDomain.CreateInstanceAndUnwrap(...)
proxyGenerator.UpdateProgressEvent += OnUpdatePregress(..);
proxyGenerator.MethodA();
}
And, caller application will interact with Assembly B, rather than C directly.
Now, if caller application is Console type, everything works well, but if caller application is WPF type, it failed and reported that "SampleForm.Window1 in ... is not marked as Serializable" (SampleForm.Window1 is WPF main window).
It confused myself, who can help me on this?
Thanks, Kent