如何在 VisualStudio 2017 上添加对 Xamarin PCL 的服务引用 [英] How to add a service reference to Xamarin PCL on VisualStudio 2017
问题描述
我正在开发一个需要连接到 WEB 服务的简单 Xamarin 跨平台移动应用程序.有一些帖子(见这里,这里和此处) 说 Visual Studio 不支持 Windows Phone 8.1 的服务引用,并且我必须从项目中删除此类目标.
不幸的是,我似乎无法在 VS2017 社区(版本 15.1 26403.7)下这样做:参见图片 Visual Studio 2017 不显示任何 Windows 8.1 目标.Windows Phone 8.1"确实在目标中,但是当我点击更改"时它没有出现......所以我无法删除它.
我知道我可以为每个特定于平台的项目(Android 或 iOS)添加一个引用,但重点是依赖单个公共服务引用并避免耗时的接口.>
感谢您的帮助!
安德烈
我很抱歉,我已经找到了答案 - 比如,发帖 45 秒后 - 将 这篇文章 和 这篇文章:
- 手动编辑便携式 .csproj
- 在TargetFrameworkProfile"中输入Profile78"
VS2017 将重新加载项目,您现在可以添加服务引用.
I'm working on a simple Xamarin cross-platform mobile application that needs to connect to a WEB Service. There are a few posts (see here, here and here) saying that Visual Studio doesn't support Service References for Windows Phone 8.1 and that I must remove such target from the project.
Unfortunately I don't seem to be able to do so under VS2017 Community (Release 15.1 26403.7): see image Visual Studio 2017 doesn't show any Windows 8.1 Target. "Windows Phone 8.1" is indeed in the targets but when I click on "Change" it doesn't appear... so I can't remove it.
I know I can add a reference to each platform-specific project (Android or iOS) but the whole point is to rely on a single common service reference and avoid time-consuming interfaces.
Thank you for your help!
Andrej
All my apologies, I have found the answer - like, 45 seconds after posting - by putting together this post and this post:
- Manually edit the portable .csproj
- In the "TargetFrameworkProfile" enter "Profile78"
VS2017 will reload the project and you will now be able to add a Service Reference.
这篇关于如何在 VisualStudio 2017 上添加对 Xamarin PCL 的服务引用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!