views:

119

answers:

1

I'm using MEF. I serialize one of the objects which relies on one of the loaded assemblies.

Now when I try to deserialize this object it throws "Unable to find assembly" exception. MEF loads the assemblies before this deserialization in another class (I assume that the scope of this is application wide, it loads them into a public property).

Since MEF has already loaded these assemblies to the application domain why BinaryFormatter.Deserialize() can't find them?

I can use System.Reflection.Assembly.Load but then what's the point of using MEF? Has MEF got special support for this?

A: 

For now assembly probing did the trick, although I'm still not sure if this is the best practices because I still bypasses MEF in here which is no good.

I'm still testing though to see if there is a side effect or something like that. Obvious disadvantage of these that I need to load same DLLs twice

dr. evil