Problem:
I got the below error when trying to start a wcf service. The full error message is:
Service cannot be started. System.InvalidOperationException: Could not find a base address that matches scheme net.tcp for the endpoint with binding NetTcpBinding. Registered base address schemes are [http].
at System.ServiceModel.ServiceHostBase.MakeAbsoluteUri(Uri relativeOrAbsoluteUri, Binding binding, UriSchemeKeyedCollection baseAddresses)
at System.ServiceModel.Description.ConfigLoader.LoadServiceDescription(ServiceHostBase host, ServiceDescription description, ServiceElement serviceElement, Action`1 addBaseAddress, Boolean skipHost)
at System.ServiceModel.ServiceHostBase.LoadConfigurationSectionInternal(ConfigLoader configLoader, ServiceDescription description, ServiceElement serviceSection)
at System.ServiceModel.ServiceHostBase.ApplyConfiguration()
at System.ServiceModel.ServiceHost.ApplyConfiguration()
at System.ServiceModel.ServiceHostBase.InitializeDescription(UriSchemeKeyedCollection baseAddresses)
at System.ServiceModel.ServiceHost.InitializeDescription(Type serviceType, UriSchemeKeyedCollec...
Cause:
The above error was coming because of miss match in endpoint address and bases address. In the endpoint i put binding="netTcpBinding" but in the base address I was giving the http://URL.
Solution:
I modified my baseAddress url and it works for me.
And my endpoint is:
I got the below error when trying to start a wcf service. The full error message is:
Service cannot be started. System.InvalidOperationException: Could not find a base address that matches scheme net.tcp for the endpoint with binding NetTcpBinding. Registered base address schemes are [http].
at System.ServiceModel.ServiceHostBase.MakeAbsoluteUri(Uri relativeOrAbsoluteUri, Binding binding, UriSchemeKeyedCollection baseAddresses)
at System.ServiceModel.Description.ConfigLoader.LoadServiceDescription(ServiceHostBase host, ServiceDescription description, ServiceElement serviceElement, Action`1 addBaseAddress, Boolean skipHost)
at System.ServiceModel.ServiceHostBase.LoadConfigurationSectionInternal(ConfigLoader configLoader, ServiceDescription description, ServiceElement serviceSection)
at System.ServiceModel.ServiceHostBase.ApplyConfiguration()
at System.ServiceModel.ServiceHost.ApplyConfiguration()
at System.ServiceModel.ServiceHostBase.InitializeDescription(UriSchemeKeyedCollection baseAddresses)
at System.ServiceModel.ServiceHost.InitializeDescription(Type serviceType, UriSchemeKeyedCollec...
Cause:
The above error was coming because of miss match in endpoint address and bases address. In the endpoint i put binding="netTcpBinding" but in the base address I was giving the http://URL.
Solution:
I modified my baseAddress url and it works for me.
<baseAddresses>
<add baseAddress="net.tcp://localhost:8732/Design_Time_Addresses/WCFTest/Service1/"/>
</baseAddresses>
And my endpoint is:
<endpoint name="NetTcpEndPoint" address="" binding="netTcpBinding" contract="WCFTest.IService1"/>