您的位置:首页 > 编程语言

wcf的svcutil.exe工具生成代码的奇怪问题

2015-05-18 14:28 519 查看
原本是用wcf的svcutil.exe生成客户端的代码,然后在本地调试、单元测试、功能集成都一切ok,但是一旦放倒win2008的服务器上就发生了很奇怪的问题,爆出如下的异常:

Type 'System.Threading.Tasks.Task`1[BitAuto.MaiChe.ESB.UserService.ActionResultsOfUserAccessTokenEntityr_PAdGrmY]' cannot be serialized. Consider marking it with the DataContractAttribute attribute, and marking all of its members you want serialized with
the DataMemberAttribute attribute. If the type is a collection, consider marking it with the CollectionDataContractAttribute. See the Microsoft .NET Framework documentation for other supported types.

但是对应的类命名是有相应的属性标签的。

后来基于工程管理的考虑,把对应的类的名字改了,然后把引用方式改成了直接服务引用,奇怪的事情发生了,上面的错误没有了。

然后把引用生成的客户端代码和svcutil.exe生成客户端的代码放在一起对比了一下,代码是不一样的,问题在此?svcutil.exe生成代码会在win2008上有问题?

最近时间比较近,暂时mark,留待忙完这段时间详细研究

有碰到过相同问题的同学请赐教啊
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: