【发布时间】:2012-09-28 09:14:25
【问题描述】:
我刚刚用最新版本(版本 2.0.0.580)替换了我在代码库(版本 2.0.0.480)中使用的以前的 protobuf-net 版本 - 因为没有针对 .Net 4.0 或 .Net 的特定版本4.5 在最新的 protobuf 版本中,我在我的项目中引用了 net30 完整 dll。
当尝试序列化包含 System.Xml.Linq.XElement 的复杂类型时,我从 protobuf 序列化程序中收到 InvalidOperationException - 异常消息指出: “没有为类型定义序列化程序:System.Xml.Linq.XElement”
我假设 XElement 缺少序列化程序与没有 .Net 4.0 构建的事实有关(因为我在我的项目中引用了 System.Xml.Linq.dll 的 v4.0.30319)。
我的项目针对 .NET 4.5 平台 - 在引用 protobuf-net V2.0.0.480 net40 构建时它工作正常。
【问题讨论】:
-
这与4.0无关;我没有特定于 4.0 的构建的原因是因为它不使用任何特定于 4.0 的类型/方法
标签: protobuf-net