异常:找不到匹配方案 net.tcp 的基地址

Exception: Could not find a base address that matches scheme net.tcp

我一直在努力重新配置工作服务以添加 netTcp 端点。

该服务托管在 IIS 8.5 上

我遇到了以下异常:

Could not find a base address that matches scheme net.tcp for the endpoint with binding NetTcpBinding. Registered base address schemes are [http,https]

堆栈跟踪:

[InvalidOperationException: Could not find a base address that matches scheme net.tcp for the endpoint with binding NetTcpBinding. Registered base address schemes are [http,https].]
System.ServiceModel.ServiceHostBase.MakeAbsoluteUri(Uri relativeOrAbsoluteUri, Binding binding, UriSchemeKeyedCollection baseAddresses) +16994291
System.ServiceModel.Description.ConfigLoader.LoadServiceDescription(ServiceHostBase host, ServiceDescription description, ServiceElement serviceElement, Action`1 addBaseAddress, Boolean skipHost) +1092
System.ServiceModel.ServiceHostBase.LoadConfigurationSectionInternal(ConfigLoader configLoader, ServiceDescription description, ServiceElement serviceSection) +89
System.ServiceModel.ServiceHost.ApplyConfiguration() +162
System.ServiceModel.ServiceHostBase.InitializeDescription(UriSchemeKeyedCollection baseAddresses) +207 System.ServiceModel.ServiceHost..ctor(Type serviceType, Uri[] baseAddresses) +474
System.ServiceModel.Activation.ServiceHostFactory.CreateServiceHost(Type serviceType, Uri[] baseAddresses) +42
System.ServiceModel.Activation.ServiceHostFactory.CreateServiceHost(String constructorString, Uri[] baseAddresses) +569
System.ServiceModel.HostingManager.CreateService(String normalizedVirtualPath, EventTraceActivity eventTraceActivity) +1435
System.ServiceModel.HostingManager.ActivateService(ServiceActivationInfo serviceActivationInfo, EventTraceActivity eventTraceActivity) +76
System.ServiceModel.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath, EventTraceActivity eventTraceActivity) +901

[ServiceActivationException: The service '/servicebus.svc' cannot be activated due to an exception during compilation. The exception message is: Could not find a base address that matches scheme net.tcp for the endpoint with binding NetTcpBinding. Registered base address schemes are [http,https]..]
System.Runtime.AsyncResult.End(IAsyncResult result) +624522
System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result) +196075
System.Web.AsyncEventExecutionStep.OnAsyncEventCompletion(IAsyncResult ar) +166

  <services>
  <service name="Niloosoft.ServiceBus" behaviorConfiguration="AuthenticationAndAuthorizationSecurity">
    <host>
      <baseAddresses>
        <add baseAddress="net.tcp://localhost:7213"/>
      </baseAddresses>
    </host>

    <endpoint
      address="secureBus"
      binding="basicHttpBinding"
      bindingConfiguration="TransportSecurity"
      contract="Niloosoft.IServiceBus" />
    <endpoint
      address="tcpBus"
      binding="netTcpBinding"
      bindingConfiguration="ServiceBusTcpBinding"
      contract="Niloosoft.IServiceBus" />
    <endpoint
     address="tcpMex"
     binding="mexTcpBinding"
     contract="IMetadataExchange" />
    <endpoint
      address="mex"
      binding="mexHttpsBinding"
      contract="IMetadataExchange" />
  </service>
</services>

绑定配置似乎适用于其他服务,但我可能遗漏了其他内容。

IIS 对每个服务都有绑定配置,我在那里添加了一个带有 *:7213 地址的 tcp 绑定。

关于我遗漏的任何建议和想法?我浏览了很多不同的帖子,看看我是否在某处犯了错误。

感谢所有帮助。

问题是配置 HttpGetEnabled 设置为 true,如果您的网络服务应该接受 HTTPS,则有必要将其设置为 false。