I'm using DynamicProxy indirectly via Moq and I'm running into a problem. AIUI, DynamicProxy maintains a cache of types that were generated. As long the types don't change, this is OK. However, in my scenario, I'm dealing with types that do get changed in runtime, and as a consequence, subsequent invocation of the mocks based on those types fails with exceptions like MissingMethodException or such.
Is there a way to ensure that certain types will never be cached or effect an invalidation of the types?