Visual Studio 2015 + Xamarin +本机便携式PCL + WCF [英] Visual Studio 2015 + Xamarin + Native Portable PCL + WCF

查看:107
本文介绍了Visual Studio 2015 + Xamarin +本机便携式PCL + WCF的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,我们的企业正在使用Visual Studio进行Xamarin路由.在线浏览所有文档显示,从Web服务创建WCF代理客户端并将其放置在PCL中应该是不容易的.经过努力并试图弄清为什么我不能使用SLSVcUtil.exe生成的类来编译PCL或为什么缺少添加服务引用"菜单项时,我放弃了并下载了示例项目.

So our enterprise is going the Xamarin route using Visual Studio. Going through all the documentation online showed that it should be Trivial to create WCF proxy client out of a web service and place it in the PCL. After Struggling and trying to figure out why I couldn't compile the PCL using the SLSVcUtil.exe generated classes or why the "Add Service Reference" menu item was missing i gave up and downloaded the sample projects.

原来,我一直缺少的是PCL的目标配置文件.使用Visual Studio 2015 + Xamarin,默认配置文件设置为111.事实证明,配置文件111不包含支持WCF,因为它以Windows Phone为目标.如果要使用WCF,则要使用的目标配置文件是78.

Turns out what I was missing all along was the target profile for the PCL. With Visual Studio 2015 + Xamarin, the default profile was set to 111. Profile 111 as it turns out does not Include support WCF as it targets Windows Phone. The target profile you want to use if you want to use WCF is 78.

那么您如何在VS 2015中更改PCL的配置文件?请参阅下面的答案.我真的希望这对以后的工作有所帮助.

So how do you change the profile of the PCL in VS 2015? See the answer below. I truly hope this helps some one in the future.

推荐答案

更改配置文件:

  1. 右键单击PCL项目上的属性".
  2. 点击目标"部分上的更改..."按钮
  3. 取消选中Windows Phone 8.1
  4. 检查Windows Phone Silverlight 8.
  5. 点击好!

个人资料的更多信息: http://danrigby.com/2014/04/16/xamarin- pcl-profile-notes/

More information of Profiles: http://danrigby.com/2014/04/16/xamarin-pcl-profile-notes/

这篇关于Visual Studio 2015 + Xamarin +本机便携式PCL + WCF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆