Deserialization error in MEF due to lack of assemblies

I am using MEF. I am serializing one of the objects that relies on one of the loaded assemblies.

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

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

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

+4
source share
1 answer

At the moment, the assembly has done the trick, although I'm still not sure if these are the best practices, because I still circumvented the MEF in this is not good.

I am still testing to see if there is a side effect or something like that. The obvious drawback of this data is that I need to load the same DLL twice

+1
source

All Articles