Я использую wcfFacility 3.3.0 и размещаю dll службы wcf в службе Windows. Это регистрация рабочего компонента для меня: (добавьте Hosted ())
public void Install(IWindsorContainer container, IConfigurationStore store)
{
container.AddFacility<LoggingFacility>(f => f.UseLog4Net());
container
.AddFacility<WcfFacility>(f =>
{
f.CloseTimeout = TimeSpan.Zero;
});
string baseAddress = "http://localhost:8744/TVIRecorderWcfService/";
container.Register(
Component
.For<ITVIRecorderWcfService>()
.ImplementedBy<TVIRecorderWcfService>()
.AsWcfService(
new DefaultServiceModel()
.AddBaseAddresses(baseAddress)
.Hosted()
//publish metadata doesn't work, have to do differently
//.PublishMetadata(x => x.EnableHttpGet()).Discoverable()
.AddEndpoints(WcfEndpoint
.BoundTo(new BasicHttpBinding()))
//.PublishMetadata(x=>x.EnableHttpGet()).Discoverable()
).LifestyleSingleton()
,
Component
.For<ServiceBase>()
.ImplementedBy<TVIRecorderService>());
}
Чтобы увидеть утилиту WcfTestClient,служба должна публиковать свои serviceMetadata Мне нужно вручную добавить serviceBehaviour и MetadataExchangeBindings после создания экземпляра моей ServiceHost
var binding = MetadataExchangeBindings.CreateMexHttpBinding();
var mexAddress = "http://localhost:8744/TVIRecorderWcfService/mex";
var behaviour = new ServiceMetadataBehavior() {HttpGetEnabled = true};
serviceHost.Description.Behaviors.Add(behaviour);
serviceHost.AddServiceEndpoint(typeof(IMetadataExchange), binding, mexAddress);