System.Runtime.Serialization.SerializationException: Unable to find assembly MyAssembly

后端 未结 9 1827
-上瘾入骨i
-上瘾入骨i 2020-12-19 04:00

So I\'ve found a bunch of threads on this topic but I don\'t think I\'ve found one that applies yet.

Basically my .exe loads a .dll (MyAssembly) file which does the

9条回答
  •  别那么骄傲
    2020-12-19 04:35

    I would check if Marc Gravell's answer here applies... in short "One option would be to move the type to a library dll that both the other projects reference - then it is only defined once, and it will be happy"

    In my case I had temporarily created a copy of the class that I intended to serialize (in the assembly doing the serializing) early in development, but forgot about it when deserializing! So the deserializer never did have access to the same class that did the serialising!

    It is also worth checking out the properties of the project containing the class being serialized - Check for typos in its assembly name. You might want to try flattening out your namespace hierachy too to see if that helps.

提交回复
热议问题