【问题标题】:can i use a generic list in a WCF called from silverlight?我可以在从 silverlight 调用的 WCF 中使用通用列表吗?
【发布时间】:2010-05-19 13:42:52
【问题描述】:

当我在 wcf 服务中返回我的自定义对象的通用列表时,silverlight 在我更新我的服务引用时给我这个错误(并且reference.cs 文件完全空白)

像这样丑陋的:

Warning 18  Custom tool warning: Cannot import wsdl:binding
Detail: There was an error importing a wsdl:portType that the wsdl:binding is dependent on.
XPath to wsdl:portType: //wsdl:definitions[@targetNamespace='']/wsdl:portType[@name='Service1']
XPath to Error Source: //wsdl:definitions[@targetNamespace='http://tempuri.org/']/wsdl:binding[@name='CustomBinding_Service1']  C:\Silverlight\POCFinRap\FinRapSilverlightPoc\FinRapSilverlightPoc\Service References\ServiceReference2\Reference.svcmap    1   1   FinRapSilverlightPoc

当我将返回类型更改为字符串时,一切正常。 (同样当我返回 List<string> 时,它会给我错误)

编辑 1:顺便说一下:它是 SL4 编辑 2:我有一个 silverlight 项目和一个 webproject(默认由 vs2010 创建),并且 SVC 在 webproject 中。

【问题讨论】:

    标签: wcf silverlight


    【解决方案1】:

    经过大量试验和错误以及我意外点击离开的帖子,因此我无法给予他/她的学分:

    “在引用的程序集中重用类型”复选框给我带来了麻烦。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2010-09-24
      • 1970-01-01
      • 2010-12-27
      • 1970-01-01
      • 2011-11-07
      • 2010-12-13
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多