我已經添加了WPF應用WCF類庫和WCF我的應用程序配置如下同時連接
<service name="WCFChatApplication.Service1">
<host>
<baseAddresses>
<add baseAddress = "http://localhost:8732/Design_Time_Addresses/WCFChatApplication/Service1/" />
</baseAddresses>
</host>
<!-- Service Endpoints -->
<!-- Unless fully qualified, address is relative to base address supplied above -->
<endpoint address ="" binding="wsDualHttpBinding" contract="WCFChatApplication.IMessageServiceInbound">
<!--
Upon deployment, the following identity element should be removed or replaced to reflect the
identity under which the deployed service runs. If removed, WCF will infer an appropriate identity
automatically.
-->
<identity>
<dns value="localhost"/>
</identity>
</endpoint>
<!-- Metadata Endpoints -->
<!-- The Metadata Exchange endpoint is used by the service to describe itself to clients. -->
<!-- This endpoint does not use a secure binding and should be secured or removed before deployment -->
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
和我的WPF應用程序cpnfig是
<bindings>
<wsDualHttpBinding>
<binding name="WSDualHttpBinding_IMessageServiceInbound" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<reliableSession ordered="true" inactivityTimeout="00:10:00" />
<security mode="Message">
<message clientCredentialType="Windows" negotiateServiceCredential="true"
algorithmSuite="Default" />
</security>
</binding>
</wsDualHttpBinding>
</bindings>
但WCF異常,當我打電話
ServiceReference1.MessageServiceInboundClient Sc1 = new ServiceReference1.MessageServiceInboundClient(new InstanceContext(this),"WSDualHttpBinding_IMessageServiceInbound");
Sc1.Open();
我得到的錯誤是
HTTP無法註冊URLhttp:// +:80/Temporary_Listen_Addresses/9b1e11c2-0c91-43a6-9a17-26f473a9fdbc /,因爲TCP端口80正在被另一個應用程序使用。
使用端口80的過程是Inetinfo.exe.I似乎無法關閉此過程。
有沒有一種方法可以從端口80移動到任何其他端口。
感謝
您如何/在哪裏託管服務? –
我正在做selfhosting – Rohit