2012-04-23 72 views
0

我有一個作爲Windows服務運行的WCF服務庫。我想將此服務作爲Azure工作者角色遷移。當我右鍵點擊一個WCF項目時,我通常會看到選項「添加Windows Azure部署項目」。用我的WCF庫,我沒有看到這個選項。在那種情況下,我如何將WCF服務庫作爲工作者角色遷移到Azure?任何幫助將不勝感激。將WCF遷移爲Azure工作者角色

下面是我的WCF服務庫的app.config。

<?xml version="1.0"?> 
<configuration> 
<system.serviceModel> 
    <bindings> 
     <netTcpBinding> 
      <binding name="NetTcpBinding_IHealthService" closeTimeout="00:01:00" 
       openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" 
       transactionFlow="false" transferMode="Buffered" transactionProtocol="OleTransactions" 
       hostNameComparisonMode="StrongWildcard" listenBacklog="10" 
       maxBufferPoolSize="524288" maxBufferSize="65536" maxConnections="10" 
       maxReceivedMessageSize="65536"> 
       <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" 
        maxBytesPerRead="4096" maxNameTableCharCount="16384" /> 
       <reliableSession ordered="true" inactivityTimeout="00:10:00" 
        enabled="false" /> 
       <security mode="None"> 
        <transport clientCredentialType="Windows" protectionLevel="EncryptAndSign" /> 
        <message clientCredentialType="Windows" algorithmSuite="Default" /> 
       </security> 
      </binding> 
     </netTcpBinding> 
    </bindings> 
    <client> 
     <endpoint address="net.tcp://localhost:9017/monitor/health/service.svc" 
      binding="netTcpBinding" bindingConfiguration="NetTcpBinding_IHealthService" 
      contract="HealthService.IHealthService" name="NetTcpBinding_IHealthService" /> 
    </client> 
</system.serviceModel> 
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup> 
</configuration> 

回答

0

僅當項目類型是WebApplication或WCF應用程序時,纔會顯示「添加Windows Azure部署項目」選項。您必須將您的WCF庫託管在WebApplication中,然後纔會顯示該選項(或者甚至可以直接在Windows Azure WebRole項目中直接託管它)。

如果你真的想在WorkerRole中託管你的WCF庫,我建議你按照許明明的解釋。但通常你在Windows Azure的WebRoles中託管你的WCF服務。所以我希望你有一個特別的需要,解釋你爲什麼要使用WorkerRoles。

我希望有幫助。

相關問題