0
我正在嘗試使用http和命名管道端點構建一個Windows服務託管的WCF服務。當我將它配置爲使用命名管道時,它工作正常,但是當我嘗試將其配置爲使用http綁定時,它將全部編譯並安裝,但是當我嘗試啓動服務時,它立即停止,而且我無法在事件查看器中查找錯誤消息。命名管道綁定在Windows服務中工作,但BasicHttp綁定失敗
這是我的app.config文件。註釋中的配置有效,沒有註釋的配置不會。
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.web>
<compilation debug="true" />
</system.web>
<!-- When deploying the service library project, the content of the config
file must be added to the host's app.config file.
System.Configuration does not support config files for libraries. -->
<system.serviceModel>
<services>
<service name="NogginWcf.NogginWcfSvc">
<endpoint address="" binding="basicHttpBinding"
bindingConfiguration="" name="BasicHttp" bindingName="BasicHttp"
contract="NogginWcf.INogginWcfSvc" />
<endpoint address="mex"
binding="mexHttpBinding" bindingConfiguration="" name="HttpMex"
bindingName="HttpMex" contract="IMetadataExchange" />
<!--<endpoint address="" binding="netNamedPipeBinding"
bindingConfiguration="" name="NamedPipes" bindingName="NamedPipes"
contract="NogginWcf.INogginWcfSvc" />
<endpoint address="mex"
binding="mexNamedPipeBinding" bindingConfiguration="" name="NamedPipesMex"
bindingName="NamedPipesMex" contract="IMetadataExchange" />-->
<host>
<baseAddresses>
<!--<add baseAddress="net.pipe://localhost/NogginPipesService" />-->
<add baseAddress="http://localhost:8000/NogginHttpService" />
</baseAddresses>
</host>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="">
<serviceMetadata httpGetEnabled="false" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
</configuration>
This MSDN tutorial演示託管使用Windows服務HTTP端點,我想我的配置看起來是正確的。
任何關於如何進行的建議都會受到歡迎。
只是一個快速檢查,你確定沒有其他人正在使用端口8000? – mageos
不 - 但我嘗試了幾個不同的端口。剛剛選中 - 沒有任何內容 –
運行Windows服務的帳戶是否有權註冊WCF服務URL?我相信它需要管理員的專業知識。 – Tim