Visual Studio 2015 + Xamarin + Native Portable PCL + WCF

南笙酒味 提交于 2020-01-02 07:27:15

问题


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.

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.

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:


To change the profile:

  1. Right Click Properties on the PCL project.
  2. Click the "Change..." button on Targets Section
  3. Uncheck Windows Phone 8.1
  4. Check Windows Phone Silverlight 8.
  5. Clcik ok!

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



来源:https://stackoverflow.com/questions/36826467/visual-studio-2015-xamarin-native-portable-pcl-wcf

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!