我有一個使用MSMQ的WCF服務,託管在IIS中。該服務不會啓動並從隊列中讀取消息,直到服務的SVC頁面的URL在瀏覽器中被點擊,這在部署和應用程序池回收之後會出現問題。要解決這一點,我安裝了IIS Application Initialization module將發送假的請求,在Web.config像這樣指定的頁面:IIS應用程序初始化模塊將請求發送到本地主機
<system.webServer>
<applicationInitialization remapManagedRequestsTo="Startup.htm" skipManagedModules="true" >
<add initializationPage="/MyService.svc" />
</applicationInitialization>
</system.webServer>
我遇到的問題是,它的打本地主機時,我的網站被綁定到另一個域名,所以我看到這個錯誤:
WebHost failed to process a request. Sender Information: System.ServiceModel.Activation.HostedHttpRequestAsyncResult/42715336 Exception: System.ServiceModel.ServiceActivationException: No protocol binding matches the given address 'http://localhost/MyService.svc'. Protocol bindings are configured at the Site level in IIS or WAS configuration. ---> System.InvalidOperationException: No protocol binding matches the given address 'http://localhost/MyService.svc'. Protocol bindings are configured at the Site level in IIS or WAS configuration.
任何想法如何解決這個問題?
不要在IIS中託管MSMQ端點? – 2012-08-10 14:40:26
@hugh Yep謝謝你。 – Charlie 2012-08-10 15:09:58