0

我正在尝试通过 WCF 从C5 集合库发送 TreeDictionary 。它可以到达收件人那里(我必须为似乎是内部数据结构的东西添加很多 KnownType 属性)。但是,现在我陷入了失败的境地,因为它无法为C5.KeyValuePair'2[typea,typeb].

这是因为 C5 类本身不能跨越 WCF(我很幸运能走到这一步)还是其他什么?

4

1 回答 1

2

C5 classes are indeed not designed to go across a serialization boundary. You have several options.

  1. Add a reference to the C5 libraries on your client side. This is not service oriented and will not work on anything but a .NET client at best. Not recommended.
  2. If possible, convert the dictionary to a regular .NET dictionary and return that. Your client ought to be able to receive this.

Good luck!

于 2009-06-01T12:53:38.947 回答