如何在 Visual Studio 2017 上添加对 Xamarin PCL 的服务引用

How to add a service reference to Xamarin PCL on VisualStudio 2017

我正在开发一个简单的 Xamarin 跨平台移动应用程序,它需要连接到 Web 服务。有一些帖子(参见 here, here and here)说 Visual Studio 不支持 Windows Phone 8.1 的服务引用,我必须从项目中删除这样的目标。

不幸的是,我似乎无法在 VS2017 社区(版本 15.1 26403.7)下这样做:见图 Visual Studio 2017 doesn't show any Windows 8.1 Target。 "Windows Phone 8.1" 确实在目标中,但是当我点击 "Change" 时它没有出现...所以我无法删除它。

我知道我可以添加对每个平台特定项目的引用(Android 或 iOS),但重点是依赖 单个 常用服务参考,避免接口耗时

感谢您的帮助!

安德烈

抱歉,我找到了答案 - 比如,在发布后 45 秒 - 通过将 this post and this post:

  • 手动编辑可移植.csproj
  • 在"TargetFrameworkProfile"中输入"Profile78"

VS2017 将重新加载项目,您现在可以添加服务引用。