Is it possible to use Castle to self host a WCF service but use all the WCF endpoint/binding info from app.config (as oppossed to setting in code via DefaultServiceModel)?
Are there any good examples of this?
I tried the following but got InvalidOperationException
//code
container.AddFacility<WcfFacility>();
..
..
container.Register(
Component.For<IAuthenticationService>()
.ImplementedBy<AuthenticationService>()
.Named("AuthenticationService")
.AsWcfService()
.LifestyleTransient()
);
//config
<system.serviceModel>
<services>
<service name="AuthenticationService">
<endpoint name ="AuthenticationService_NetTcp" address="net.tcp://localhost:9872/authenticationservice.svc" binding="netTcpBinding" contract="Foo.IAuthenticationService" />
</service>
</services>
</system.serviceModel>
//exception
AuthenticationService' has zero application (non-infrastructure) endpoints. This might be because no configuration file was found for your application, or because no service element matching the service name could be found in the configuration file, or because no endpoints were defined in the service element.
.Net 3.5
Castle 3.3.0
Windows 2012
thanks
scott