共享类的 WCF 错误服务错误消息

发布于 2024-08-26 00:42:44 字数 397 浏览 5 评论 0原文

源代码: http://code.google.com/p /sevenupdate/source/browse/#hg/Source/SevenUpdate.Base

SevenUpdate.Base.Sui 无法使用,因为它与导入的 DataContract 不匹配。需要从引用类型中排除此类型。

现在我尝试取消选中重用引用类型,并且能够编译我的项目。但是当从客户端发送集合时,它从未被接收或无法在服务器端反序列化。

我真的需要这个才能工作。任何帮助将不胜感激,完整源代码由谷歌代码提供。

Source code:
http://code.google.com/p/sevenupdate/source/browse/#hg/Source/SevenUpdate.Base

SevenUpdate.Base.Sui cannot be used since it does not match imported DataContract. Need to exclude this type from referenced types.

Now I tried unchecking reuse reference types and I was able to get my project to compile. but when sending a collection from the client it was never received or couldn't be deserialized on the server end.

I really need this to work. Any help would be appreciated, the fullsource code is provided by google code.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

執念 2024-09-02 00:42:44

我没有下载源代码并构建它,但是您是否在此类上缺少 DataContract? Sui 类有一个 Sua 类型的属性作为 DataMember,因此它也需要序列化。当前在您的代码中看起来像这样

[ProtoContract, ]
[KnownType(typeof(ObservableCollection<LocaleString>))]
public class Sua

I didnt download the source and build it, but could it be that you are missing DataContract on this class? Sui class has a property of type Sua as DataMember so it will need to be serialized as well. It looks like this in your code currently

[ProtoContract, ]
[KnownType(typeof(ObservableCollection<LocaleString>))]
public class Sua
痞味浪人 2024-09-02 00:42:44

我需要做什么才能重现此错误?第一点(关于匹配数据合同)听起来像是 WCF 对您不太满意,这表明您有两个相似(但不同)的合同“正在使用”。如果您重复使用共享库中的类型,这应该不是问题。

如果您最终排除了类型(并且在客户端和服务器上具有不同的模型),那么它可能会得到一个位欺骗,因为“mex”并不能保证位置将保持不变(并且 indde,它们会定期更改) - 但您可以在分部类中修复此问题,方法是针对 type< /em> (不漂亮但有效)。

但我强调 - 这里的主要问题似乎是 WCF;如果 不高兴,以至于代码无法进行代码生成/编译等,那么我的手就被束缚了(因为它无法与 protobuf-net 进行对话)。

What would I need to do to reproduce this error? The first bit (about matching data-contract) sounds like WCF isn't very happy with you, which suggests you have two similar (but different) contracts "in play". If you are re-using the types from a shared library this shouldn't be a problem.

If you do end up excluding the types (and having a different model at the client and server) then it can get a bit tricker, since "mex" doesn't guarantee the positions will remain intact (and indde, they regularly change) - but you can fix this in a partial class, by using a few [ProtoPartialMember(...)] against the type (not pretty but it works).

But I stress - the main problem here seems to be WCF; if that isn't happy such that the code doesn't codegen / compile etc, then my hands are fairly tied (since it won't get as far as talking to protobuf-net).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文