无法识别URI前缀。元数据包含无法解析的引用。 [英] The URI prefix is not recognized. Metadata contains a reference that cannot be resolved.

查看:922
本文介绍了无法识别URI前缀。元数据包含无法解析的引用。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个WCF服务,它自托管在app.config以下的控制台应用程序中:

I have a WCF Service that self hosted in a console application with below app.config:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
  </startup>
    <system.serviceModel>
        <behaviors>
            <serviceBehaviors>
                <behavior name="serviceBehavior">
                    <serviceMetadata httpGetEnabled="false"/>
                </behavior>
            </serviceBehaviors>
        </behaviors>
        <services>
            <service name="TestService.Service" behaviorConfiguration="serviceBehavior">
                <clear />
                <endpoint address="net.tcp://127.0.0.1:7474/Service" binding="netTcpBinding"

                    contract="TestService.IService">                    
                </endpoint>
                <endpoint address="mex" binding="mexTcpBinding" bindingConfiguration=""

                    contract="IMetadataExchange" />
                <host>
                    <baseAddresses>
                        <add baseAddress="net.tcp://127.0.0.1:7474/Service" />
                    </baseAddresses>
                </host>
            </service>
        </services>
    </system.serviceModel>
</configuration>

<运行此控制台程序后,我尝试通过添加来自另一个项目中的客户端应用程序的服务引用来连接此服务。


但是它说:

无法识别URI前缀。

元数据包含一个无法解析的引用:'net.tcp://127.0.0.1:7474/Service '。

套接字连接已中止。这可能是由于处理消息的错误或远程主机超出接收超时或基础网络资源问题引起的。本地套接字超时为'00:04:59.9359963'。

远程主机强行关闭现有连接

如果在当前解决方案中定义了服务,请尝试构建解决方案并再次添加服务参考。



有人可以告诉我这是什么问题吗?

我在谷歌搜索了几天但是没有



after I run this console program, i try to connect this service by adding service reference from a client application in another project. but it says:
The URI prefix is not recognized.
Metadata contains a reference that cannot be resolved: 'net.tcp://127.0.0.1:7474/Service'.
The socket connection was aborted. This could be caused by an error processing your message or a receive timeout being exceeded by the remote host, or an underlying network resource issue. Local socket timeout was '00:04:59.9359963'.
An existing connection was forcibly closed by the remote host
If the service is defined in the current solution, try building the solution and adding the service reference again.

can someone tell me what's the problem ?
I search in google a couple of days but nothing

推荐答案

这篇关于无法识别URI前缀。元数据包含无法解析的引用。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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