Windows Phone & 添加service reference 出错
2012-06-06 12:50
267 查看
最近几天在学习windows phone7的开发,在做Location Service时遇到一个问题,就是添加一个Service Reference(我添加的是http://msrmaps.com/TerraService2.asmx,大家应该都熟悉,不会有什么问题)后,出现5个警告和一个错误,它们分别是:
Warning 1 Custom tool warning: Cannot import wsdl:portType
Detail: An exception was thrown while running a WSDL import extension: System.ServiceModel.Description.DataContractSerializerMessageContractImporter
Error: Could not load type 'System.Runtime.Serialization.DataContractSet' from assembly 'System.Runtime.Serialization, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e'.
XPath to Error Source: //wsdl:definitions[@targetNamespace='http://msrmaps.com/']/wsdl:portType[@name='TerraServiceSoap'] E:\ASP.NET\Visual Studio 2010\Projects\XapNote\XapNote\Service
References\myTerraService\Reference.svcmap 1 1 XapNote
Warning 2 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='http://msrmaps.com/']/wsdl:portType[@name='TerraServiceSoap']
XPath to Error Source: //wsdl:definitions[@targetNamespace='http://msrmaps.com/']/wsdl:binding[@name='TerraServiceSoap'] E:\ASP.NET\Visual Studio 2010\Projects\XapNote\XapNote\Service
References\myTerraService\Reference.svcmap 1 1 XapNote
Warning 3 Custom tool warning: Cannot import wsdl:port
Detail: There was an error importing a wsdl:binding that the wsdl:port is dependent on.
XPath to wsdl:binding: //wsdl:definitions[@targetNamespace='http://msrmaps.com/']/wsdl:binding[@name='TerraServiceSoap']
XPath to Error Source: //wsdl:definitions[@targetNamespace='http://msrmaps.com/']/wsdl:service[@name='TerraService']/wsdl:port[@name='TerraServiceSoap'] E:\ASP.NET\Visual Studio
2010\Projects\XapNote\XapNote\Service References\myTerraService\Reference.svcmap 1 1 XapNote
Warning 4 Custom tool warning: No endpoints compatible with Silverlight 3 were found. The generated client class will not be usable unless endpoint information is provided via
the constructor. E:\ASP.NET\Visual Studio 2010\Projects\XapNote\XapNote\Service References\myTerraService\Reference.svcmap 1 1 XapNote
Warning 5 Custom tool warning: Exception has been thrown by the target of an invocation. E:\ASP.NET\Visual Studio 2010\Projects\XapNote\XapNote\Service References\myTerraService\Reference.svcmap
1 1 XapNote
Error 6 Custom tool error: Failed to generate code for the service reference 'myTerraService'. Please check other error and warning messages for details. E:\ASP.NET\Visual
Studio 2010\Projects\XapNote\XapNote\Service References\myTerraService\Reference.svcmap 1 1 XapNote
解决办法:
添加service reference 的时候选择advanced
select Generic.List for
collection type, uncheck the reuse types in reference assemblies and the compilation is succesfull
希望帮助到别人
Warning 1 Custom tool warning: Cannot import wsdl:portType
Detail: An exception was thrown while running a WSDL import extension: System.ServiceModel.Description.DataContractSerializerMessageContractImporter
Error: Could not load type 'System.Runtime.Serialization.DataContractSet' from assembly 'System.Runtime.Serialization, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e'.
XPath to Error Source: //wsdl:definitions[@targetNamespace='http://msrmaps.com/']/wsdl:portType[@name='TerraServiceSoap'] E:\ASP.NET\Visual Studio 2010\Projects\XapNote\XapNote\Service
References\myTerraService\Reference.svcmap 1 1 XapNote
Warning 2 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='http://msrmaps.com/']/wsdl:portType[@name='TerraServiceSoap']
XPath to Error Source: //wsdl:definitions[@targetNamespace='http://msrmaps.com/']/wsdl:binding[@name='TerraServiceSoap'] E:\ASP.NET\Visual Studio 2010\Projects\XapNote\XapNote\Service
References\myTerraService\Reference.svcmap 1 1 XapNote
Warning 3 Custom tool warning: Cannot import wsdl:port
Detail: There was an error importing a wsdl:binding that the wsdl:port is dependent on.
XPath to wsdl:binding: //wsdl:definitions[@targetNamespace='http://msrmaps.com/']/wsdl:binding[@name='TerraServiceSoap']
XPath to Error Source: //wsdl:definitions[@targetNamespace='http://msrmaps.com/']/wsdl:service[@name='TerraService']/wsdl:port[@name='TerraServiceSoap'] E:\ASP.NET\Visual Studio
2010\Projects\XapNote\XapNote\Service References\myTerraService\Reference.svcmap 1 1 XapNote
Warning 4 Custom tool warning: No endpoints compatible with Silverlight 3 were found. The generated client class will not be usable unless endpoint information is provided via
the constructor. E:\ASP.NET\Visual Studio 2010\Projects\XapNote\XapNote\Service References\myTerraService\Reference.svcmap 1 1 XapNote
Warning 5 Custom tool warning: Exception has been thrown by the target of an invocation. E:\ASP.NET\Visual Studio 2010\Projects\XapNote\XapNote\Service References\myTerraService\Reference.svcmap
1 1 XapNote
Error 6 Custom tool error: Failed to generate code for the service reference 'myTerraService'. Please check other error and warning messages for details. E:\ASP.NET\Visual
Studio 2010\Projects\XapNote\XapNote\Service References\myTerraService\Reference.svcmap 1 1 XapNote
解决办法:
添加service reference 的时候选择advanced
select Generic.List for
collection type, uncheck the reuse types in reference assemblies and the compilation is succesfull
希望帮助到别人
相关文章推荐
- 添加web引用和添加服务引用有什么区别?Add Service References 和 Add Web References 有啥区别?
- Windows Phone & Windows App应用程序崩溃crash信息抓取方法
- 编译出错 "undefined reference to"
- 学习WPF,转向移动互联网(windows phone && windows 8 )开发(下)
- 【万里征程——Windows App开发】ListView&GridView之添加数据
- Python: Windows下pip安装库出错:Microsoft Visual C++ 9.0 is required < Unable to find vcvarsall.bat
- 配置安装Apache主服务发生错误:"(OS 5)拒绝访问。 : AH00369: Failed to open the Windows service manager, perh······ "
- 再谈Windows phone盖茨的口代梦想
- 安装MYSQL出错:a windows service with the name MYSQL already...service.
- 【转载】学习WPF,转向移动互联网(windows phone && windows 8 )开发(下)
- Microsoft Passport & Windows Live ID Service
- Silverlight添加服务引用Service Reference, 出现“自定义工具错误,无法生成服务引用”错误的解决办法
- c# Add Web Reference和Add Service Reference添加webservice的区别之一
- cocos2d-x android 添加新场景报错: undefined reference to `vtable for XXX'
- Could not find default endpoint element that references contract 'wcfXXXXXXXXXXX' in the ServiceMode
- 配置安装Apache主服务发生错误:"(OS 5)拒绝访问。 : AH00369: Failed to open the Windows service manager, perh······ "
- For Windows Phone8 phones make sure that the Windows Phone IP Over USB Transport(IpOverUsbSvc) service is running
- 添加web引用和添加服务引用有什么区别?Add Service References 和 Add Web References 有啥区别?
- WindowsPhone&Windows8.1&Windows8&Unity3d 填坑日记
- Vmware 精简版 打开vmx虚拟机出错 encoding "windows-1251". 的解决方法(转http://hi.baidu.com/zqjiang/blog/item/381d377)