简体   繁体   English

Windows Phone Silverlight 8.1项目中的WCF服务

[英]WCF Service in Windows Phone Silverlight 8.1 Project

I cannot seem to access my WCF Service from Windows Phone Silverlight 8.1 application. 我似乎无法从Windows Phone Silverlight 8.1应用程序访问WCF服务。

I am able to add a service reference, like for example in a console applications, but the following code does not work 我可以添加服务引用,例如在控制台应用程序中,但是以下代码不起作用

ServiceReference1.MojaSmetkaWcfClient client = new MojaSmetkaWcfClient();
var result = client.GetData(0);

It says 'Cannot resolve symbol ServiceReference1'. 它说“无法解析符号ServiceReference1”。 This works in a console app project. 这适用于控制台应用程序项目。 How can I connect to the WCF service. 如何连接到WCF服务。 If it is not possible, are there any alternatives similar to WCF? 如果不可能,是否有与WCF类似的替代方法? Thanks 谢谢

I have solved this by updating my VS2013 to Update 5 (maybe that didn't help solving the problem) and doing the following: 我已通过将VS2013更新为Update 5(也许这无助于解决问题)并执行以下操作解决了此问题:

  1. Right click on the service reference 右键单击服务参考
  2. Configure service reference 配置服务参考
  3. Uncheck 'Reuse types in referenced assemblies' 取消选中“在引用的程序集中重用类型”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM