0

Windows サービスとして実行される WCF サービス ライブラリがあります。このサービスを Azure ワーカー ロールとして移行したいと考えています。WCF プロジェクトを右クリックすると、通常、[Windows Azure 展開プロジェクトの追加] オプションが表示されます。私の WCF ライブラリでは、このオプションが表示されません。その場合、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>
4

2 に答える 2

1

この場合、worker ロール プロジェクトを手動で作成し、サービス ライブラリ プロジェクトへの参照を追加してから、worker ロール内でサービスをホストすることをお勧めします。サービス ホスト コードは、通常のコンソール/Windows サービス ホストで得られるものと似ています。ただし、アドレスはコードで取得してください。さらに、完全なチュートリアルについては、 http://msdn.microsoft.com/en-us/WAZPlatformTrainingCourse_WindowsAzureRoleCommunicationVS2010Labを参照できます。

よろしくお願いします、

明徐。

于 2012-04-24T06:52:11.683 に答える
0

[Windows Azure 展開プロジェクトの追加] オプションは、プロジェクトの種類が Web アプリケーションまたは WCF アプリケーションの場合にのみ表示されます。WCF ライブラリを WebApplication でホストする必要があり、オプションが表示されます (または、Windows Azure WebRole プロジェクトで直接ホストすることをお勧めします)。

WCF ライブラリを WorkerRole で本当にホストしたい場合は、Ming Xu が説明したことを実行することをお勧めします。ただし、通常は Windows Azure の WebRoles で WCF サービスをホストします。そのため、WorkerRoles を使用する理由を説明する特別なニーズがあることを願っています。

それが役立つことを願っています。

于 2012-06-16T18:33:49.280 に答える