I've run into this apparently not uncommon problem --
I have a interface in Assembly A.
I am dynamically loading Assembly B, and trying to cast an object from it into my interface from Assembly A.
It's failing with an InvalidCastException.
I've come to understand why -- a class in Assembly A and a class in Assembly B, even with the same name and the same code, are not the same thing and cannot be cast to one another.
My question is: is there a solution to this? Is there any way I can make the two types compatible, or do I need to duplicate my interface in Assembly B and cast the object to that?
I'm loading Assembly B with Assembly.LoadFrom -- is there a different way to do that which would make them type-compatible?
I can't be the first person to have this problem. What I'm trying to do would seem like a fairly common task with plugin architectures.