简体   繁体   English

例外:只能将绝对URI用作基地址

[英]Exception: Only an absolute URI can be used as a base address

I saw a similar problem on the site, but I checked my base address and did not notice any problems. 我在网站上看到了类似的问题,但是我检查了我的基本地址,但没有发现任何问题。 When start debugging my project, i got this exception:Only an absolute URI can be used as a base address. 当开始调试我的项目时,我遇到了这个异常:只有绝对URI可以用作基地址。

My Host Application 我的主机申请

private ServiceHost _presenterServiceHost;
public void Start()
{ 
if(_presenterServiceHost !=null)
                    _presenterServiceHost.Close();
                _presenterServiceHost=new ServiceHost(typeof(Business.FXCTSPipeConnectionsProvider));
                _presenterServiceHost.Open();
}

Contract Implementation 合同执行

public  class FXCTSPipeConnectionsProvider:IFXCTSPipeConnectionsProvider
    {
      public string Request(string query)
      {
         var response= Container.Get(query);
          return response;
      }
    }

Contract 合同

[ServiceContract(Name ="FXCTSPipeConnectionsProvider")]
   public interface IFXCTSPipeConnectionsProvider
   {
        [OperationContract]
       string Request(string query);
   }
}

App Config 应用配置

<system.serviceModel>
    <services>
      <service name="FXCTSPipeConnectionsProvider.Business.FXCTSPipeConnectionsProvider" behaviorConfiguration="ServiceBehavior">
        <endpoint address="" binding="netNamedPipeBinding" contract="FXCTSPipeConnectionsProvider.Business.IFXCTSPipeConnectionsProvider" />
        <endpoint address="mex" binding="mexNamedPipeBinding" contract="IMetadataExchange" />
        <host>
          <baseAddresses>
            <add baseAddress="net.pipe://localhost:9011/FXCTSPipeConnectionsProvider" />
          </baseAddresses>
        </host>
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="ServiceBehavior">
          <serviceMetadata httpGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="true" />
          <serviceThrottling maxConcurrentCalls="50" maxConcurrentInstances="20" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>

只需删除端口号并将URL更改为: net.pipe://localhost/FXCTSPipeConnectionsProvider

暂无
暂无

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

相关问题 只有绝对URI可以用作基址 - Only an absolute URI can be used as a base address &#39;提供了无效的请求URI。 连接到AF中的SP的请求URI必须是绝对URI或必须设置BaseAddress - 'An invalid request URI was provided. The request URI must either be an absolute URI or BaseAddress must be set' exception connecting to a SP in an AF uri相对vs绝对 - uri relative vs absolute 是否可以创建不是绝对的Uri? - Is it possible to create a Uri that is not absolute? WCF 异常:找不到与端点的方案 http 匹配的基地址 - WCF Exception: Could not find a base address that matches scheme http for the endpoint 例外:找不到与方案net.tcp匹配的基址 - Exception: Could not find a base address that matches scheme net.tcp 为WCF服务运行ServiceHost应用程序时出现异常-无http基地址 - Exception while running ServiceHost app for WCF service - no http base address DropDownList绑定get数据绑定方法(例如Eval(),XPath()和Bind())只能在数据绑定控件异常的上下文中使用 - DropDownList binding get Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control exception &#39;await&#39;运算符只能在具有c#异常的异步方法中使用吗? - 'await' operator can only be used within an async method with c# exception? MessageWebSocket用于连接的URI可以是IP地址,对吗? - The URI that MessageWebSocket uses to connect can be an IP address, correct?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM