WCF服务引用不工作的其他电脑上 [英] WCF Service reference not working on other PC

查看:95
本文介绍了WCF服务引用不工作的其他电脑上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Windows应用商店 - 与净TCP WCF服务相同的PC(在控制台应用程序托管)上运行的地铁连接应用程序,但在Windows 8桌面模式我已经加入城域应用和内部WCF服务的参考一切工作正常。



我包我的店里/城域应用和WCF服务,并尝试另一种PC不具备安装Visual Studio,所以我不重新编译代码,我只是安装地铁应用程序包和运行WCF服务的可执行文件。 WCF服务启动正常,但是当我启动我的城域程序的时候,给我的错误(见下图)



看来,由于某种原因,地铁应用在其他计算机上安装的无法找到服务的参考。我已经使用Google,但没有工作后,尝试了很多东西。任何想法/提示/建议将不胜感激。




< DIV CLASS =h2_lin>解决方案

Windows应用商店的应用程序一般不能在同一进程中使用回送地址,除1)通信,或用于开发目的2)。从如何启用环回和排除网络隔离




使用IP环回地址的网络通信,不能在Windows商店应用用于进程间通信(两个不同的应用程序之间),因为这是通过限制网络隔离。使用IP环回地址网络通讯被允许用于通信目的在同一进程中的应用程序中。



一个开发人员可能需要使用环回测试或调试的目的,即使该功能将无法使用客户。例如,一个应用程序可能需要从从Windows商店应用的Web服务下载数据。对于开发目的,开发人员希望测试配置与Web服务在本地127.0.0.1一台计算机上的应用程序。



环回仅允许用于开发目的。由Visual Studio之外安装在Windows商店应用的使用是不允许的。




在生产场景中,你可能会得一个单独的机器上安装WCF服务。请注意,您必须启用您的应用程序清单的专用网络功能(在客户端应用程序),使本地网络访问。


I have a Windows Store - Metro app that connects with a Net TCP WCF Service running on same PC (hosted in a console application) but on Desktop mode of Windows 8. I have added a reference of WCF Service inside metro app and everything works fine.

I package my store/metro app and WCF Service and try out on another PC which don't have Visual Studio installed so I don't recompile the code, I just install the metro app package and run the executable of WCF Service. WCF Service starts fine but when I launch my metro app it give me error (see the image below)

It seems that for some reason metro app when installed on other PC is unable to find the service reference. I have tried many things after googling but nothing works. Any ideas/hint/suggestion would be greatly appreciated.

解决方案

Windows Store Apps generally cannot use the loopback address, except for 1) communication within the SAME process, or 2) for development purposes. From How to enable loopback and troubleshoot network isolation:

Network communications using an IP loopback address cannot be used for interprocess communication (between two different apps) in a Windows Store app since this is restricted by network isolation. Network communication using an IP loopback address is allowed within an app within the same process for communication purposes.

A developer may want to use loopback for testing or debugging purposes, even though that capability will not be available for customers. For example, an app may want to download data from a web service from a Windows Store app. For development purposes, the developer wants to test the app on a single computer that is configured with the web service locally on 127.0.0.1.

Loopback is permitted only for development purposes. Usage by a Windows Store app installed outside of Visual Studio is not permitted.

In a production scenario, you will likely have to install the WCF service on a separate machine. Note that you will have to enable the "private network" capability in your application manifest (on the client app) to enable local network access.

这篇关于WCF服务引用不工作的其他电脑上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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