Serialization Hurts Me

time to read 2 min | 207 words

I am now adding serialization support to Dynamic Proxy 2, and it is painful. It is painful because:

  • I never did much with serialization, and there seem to be a lot of black magic there with regard to whatever you implement ISerializable, has [Serializable] or use any of the special hooks.
  • I am working with serializaztion by directly manipulating the IL generation. This makes for fun debugging.
  • Dyanmic Proxy needs a couple special serialization hooks in order to work properly, see the first point.

At this point, I feel like my head is spinning, but I think that the tests are passing...

Update: Seems that I spoke too soon, I am bravely discoverring new exceptions:

System.TypeLoadException : Could not load type 'ObjectProxyeefadda2f25c4dffafe2b0f3c2736c95' from assembly 'DynamicProxyGenAssembly2, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' because it attempts to implement a class as an interface.