C# &引用;连接尝试失败,因为连接方在一段时间后没有正确响应”;尝试访问windows服务时
我已经创建了一个windows服务,并将该服务引用添加到我的metro应用程序中 我已经创建了一个软件包,并在另一个系统和windows服务中安装了该软件包。应用程序已成功安装。现在我尝试运行应用程序。调用服务时引发以下异常 没有端点在侦听 "http://localhost/TFSClientWindowsService/TFSCClientWindowsService/ 这可能会接受该消息。这通常是由不正确的 地址或SOAP操作。InnerException:连接尝试失败 因为关联方在一段时间后未作出适当回应 时间,或由于连接的主机失败而建立的连接失败 在127.0.0.1:80作出响应 以下是我在服务级别的配置设置:C# &引用;连接尝试失败,因为连接方在一段时间后没有正确响应”;尝试访问windows服务时,c#,wcf,windows-8,microsoft-metro,C#,Wcf,Windows 8,Microsoft Metro,我已经创建了一个windows服务,并将该服务引用添加到我的metro应用程序中 我已经创建了一个软件包,并在另一个系统和windows服务中安装了该软件包。应用程序已成功安装。现在我尝试运行应用程序。调用服务时引发以下异常 没有端点在侦听 "http://localhost/TFSClientWindowsService/TFSCClientWindowsService/ 这可能会接受该消息。这通常是由不正确的 地址或SOAP操作。InnerException:连接尝试失败 因为关联方在一段时
<?xml version="1.0"?>
<configuration>
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="MyBehavior">
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service name="TFSClientWindowsService.TFSCClientWindowsService" behaviorConfiguration="MyBehavior">
<endpoint address="" binding="basicHttpBinding" contract="TFSClientWindowsService.ITFSCClientWindowsService">
<identity>
<dns value="localhost"/>
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
<host>
<baseAddresses>
<add baseAddress="http://localhost/TFSClientWindowsService/TFSCClientWindowsService/"/>
</baseAddresses>
</host>
</service>
</services>
</system.serviceModel>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup>
</configuration>
当我安装软件包并访问该服务时,它在我的系统中正常运行。但当我在另一个系统中安装它时,它不会正常运行。如果您正在开发WinRT应用程序,您无法与运行在localhost上的服务进行对话。有关更多讨论,请参阅此线程…您正在连接到localhost,这只适用于客户端和服务器都在同一台计算机上。异常文本还显示它正在尝试连接到端口80,但您的配置显示为8732。也请检查您的防火墙。你好,Brand,Thaks了解您的响应。CheckNetIsolation LoopbackExcept-a-n=packageName对我有效