[英]Changing Type's Namespace During Binary Serialization Before .NET 4
Doing this is .NET 4.0 and newer is trivial using the BindToName method, which is the opposite of the BindToType method of the SerializationBinder. 在.NET 4.0上执行此操作,使用BindToName方法则较新,这与SerializationBinder的BindToType方法相反。 But, does anyone know a way to do this in .NET 3.5 ?
但是,有谁知道在.NET 3.5中执行此操作的方法吗?
Note: The .NET 4.0 answer to this is here. 注意:.NET 4.0的答案在这里。
I think you need to use something which implements the ISerializationSurrogate interface to do this,and its quite a lot of work. 我认为您需要使用实现ISerializationSurrogate接口的工具来完成此工作,并且需要进行大量工作。
Check out this MSDN article by Jeffrey Richter from back in 2002. 请查阅2002年Jeffrey Richter撰写的MSDN文章 。
It's unfortunately all fantastically fiddly. 不幸的是,一切都很奇特。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.