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

原本是用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,留待忙完这段时间详细研究

有碰到过相同问题的同学请赐教啊

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值