我已經創建了一個基於following sample from microsoft的Sync Framework應用程序,並將其部署到新的Windows 7計算機上進行測試。該應用程序運行正常,但是當我試圖傳達我得到以下錯誤:WCF應用程序部署在Win7機器上並獲取連接拒絕錯誤
Could not connect to http://localhost:8000/RelationalSyncContract/SqlSyncService/ . TCP error code 10061: No connection could be made because the target machine actively refused it 127.0.0.1:8000.
我想知道如果有什麼我失蹤。這是我第一次使用WCF並遵循微軟示例代碼的經驗。
我已禁用防火牆併爲TCP和UDP打開端口8000。不知道接下來要看什麼。下面是我的App.config文件,如果這有幫助:
<?xml version="1.0"?>
<configuration>
<system.web>
<compilation debug="true"/>
<httpRuntime maxRequestLength="32768" />
</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 behaviorConfiguration="WebSyncContract.SyncServiceBehavior" name="WebSyncContract.SqlWebSyncService">
<endpoint address="" binding="wsHttpBinding" bindingConfiguration="largeMessageHttpBinding" contract="WebSyncContract.ISqlSyncContract">
<identity>
<dns value="localhost"/>
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
<host>
<baseAddresses>
<add baseAddress="http://localhost:8000/RelationalSyncContract/SqlSyncService/"/>
</baseAddresses>
</host>
</service>
</services>
<bindings>
<wsHttpBinding>
<!-- We are using Server cert only.-->
<binding name="largeMessageHttpBinding" maxReceivedMessageSize="204857600">
<readerQuotas maxArrayLength="1000000"/>
</binding>
</wsHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="WebSyncContract.SyncServiceBehavior">
<!-- To avoid disclosing metadata information,
set the value below to false and remove the metadata endpoint above before deployment -->
<serviceMetadata httpGetEnabled="True"/>
<!-- To receive exception details in faults for debugging purposes,
set the value below to true. Set to false before deployment
to avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="True"/>
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
<startup><supportedRuntime version="v2.0.50727"/></startup></configuration>
謝謝,您的幫助是非常感謝。
我認爲它可能有些事情要做WCF服務主機沒有啓動..所以需要找到如何在部署機器上啓動它.. Visual Studio自動啓動它.. – Belliez 2010-04-15 14:36:13