在 VS2017 Xamarin 跨平台项目中,如何向库项目(不是平台项目)添加 Web 服务引用? [英] In a VS2017 Xamarin cross platform project, how do I add a web service reference to the library project (NOT the platform projects)?

查看:36
本文介绍了在 VS2017 Xamarin 跨平台项目中,如何向库项目(不是平台项目)添加 Web 服务引用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚安装了 VS2017 版本并启动了一个 Xamarin 跨平台项目(实际上有 4 个,如下所示).我认为无法在任何可能的配置(即表单或本机、共享或可移植)中向库项目添加 Web 服务引用.我是否只是缺少执行此操作的新方法,或者是否需要更改某种设置才能启用此功能.

I've just installed the VS2017 release and started a Xamarin cross platform project (actually 4 of them as you'll see below). I see no way to add a web service reference to the library projects in any of the possible configurations (i.e., forms or native, shared or portable). Am I just missing a new method for doing this or is there some kind of setting I need to change to enable this.

奇怪的是,我可以将它们添加到 iOS 和 Android 项目中.然而,对我来说,将完全相同的东西添加到这两个项目中似乎很奇怪和多余,因为它似乎属于图书馆项目供他们两个共享.

Oddly, I CAN add them to the iOS and Android projects. However, it seems strange and redundant to me to add the exact same thing to both of those projects when, seemingly, it belongs in the library project for the two of them to share.

我在下面添加了解决方案资源管理器的屏幕截图.

I've added screen shots of the solution explorer below.

推荐答案

Would 这个答案 解决了您的问题吗?手动编辑 .csproj,将目标配置文件更改为Profile78",然后您应该会在平台项目中看到添加服务引用".

Would this answer solve your issue? Manually edit the .csproj, change target profile to "Profile78" then you should see the "Add Service Reference" in the platform project.

这篇关于在 VS2017 Xamarin 跨平台项目中,如何向库项目(不是平台项目)添加 Web 服务引用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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