简体   繁体   English

Visual Studio 2015 无法添加服务引用

[英]Visual studio 2015 can't add Service Reference

I know there are a lot of questions like this, but none of them solved my problem.我知道有很多这样的问题,但没有一个能解决我的问题。

I have a Windows Phone project, with some associated projects.我有一个 Windows Phone 项目,以及一些相关的项目。 I need to create a new project with the service reference, but I can't add it.我需要使用服务引用创建一个新项目,但我无法添加它。

I found a link where they said to install a component from Add Connected Service > find other services > WCF Services but it says that my project is not supported.我找到了一个链接,他们说从“添加连接服务”>“查找其他服务”>“WCF 服务”安装组件,但它说我的项目不受支持。

Which kind of project must I create?我必须创建哪种项目? I have in the same solution a project which has the right-click > add service reference but I was not the creator and I don't know what kind of project it is.我在同一个解决方案中有一个项目,该项目具有右键单击 > 添加服务引用,但我不是创建者,我不知道它是什么类型的项目。

PS: - I can't right click > Add service reference, I tried it in both project name and reference name. PS:-我不能右键单击>添加服务引用,我在项目名称和引用名称中都尝试过。 - I need a Windows Phone Stuff. - 我需要一个 Windows Phone 的东西。 I link what i mean with a picture:我将我的意思与图片联系起来: 在此处输入图片说明 PSS: The destination version of windows phone is not the reason. PSS: windows phone 的目标版本不是原因。 I tryed changing the WP8.0 into WP8.1 and I can still add the ref我尝试将 WP8.0 更改为 WP8.1,但仍然可以添加参考

Does anyone know which kind of project I have to add for being able to add service ref?有谁知道我必须添加哪种项目才能添加服务引用?

Thanks谢谢

Instead of using Service Reference would suggest you to switch to the Windows recommended REST API endpoints instead.建议您改用 Windows 推荐的REST API 端点,而不是使用服务参考。 As now Windows is focusing more on REST service consumption than adding service reference that was available earlier.现在 Windows 更关注 REST 服务消费,而不是添加早期可用的服务引用。
Sadly now Windows Phone Store apps in Windows Phone 8.1 do not support the System.ServiceModel namespace generated by the Add Service Reference menu.遗憾的是,现在Windows Phone Store Windows Phone 8.1 Windows Phone Store应用程序不支持“添加服务引用”菜单生成的System.ServiceModel命名空间。 Hence they have removed the option Add Service Reference .因此,他们删除了选项Add Service Reference
To be able to use it you will have to create a Silverlight application and use this Workaround of using a WCF service.为了能够使用它,您必须创建一个 Silverlight 应用程序并使用这个使用 WCF 服务的解决方法
You can find a MSDN Forum discussion of the same.您可以在MSDN 论坛上找到相同的讨论。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM