私は、オブジェクトをキャッシュする空白のサービスファブリックアプリケーション/サービスを構築しました。以下のコードでは、サービスを呼び出すコンソールウィンドウでクライアントを作成しました。 c.Addにブレークポイントを置き、それをステップオーバーすると、プログラムは終了します。例外はスローされず、 "done"は出力されず、プログラムはコード0で終了します。 サービスは実行中であり、正常な状態です。私は何が間違っているかを見つけるために何ができますか?サービスファブリッククライアントはただ終了します
class Program
{
static void Main(string[] args)
{
Test();
}
static async void Test()
{
Uri serviceName = new Uri("fabric:/CacheApp/PreorderCache");
ServicePartitionResolver resolver = new ServicePartitionResolver(() => new System.Fabric.FabricClient());
NetTcpBinding binding = (NetTcpBinding)WcfUtility.CreateTcpClientBinding();
Client c = new Client(new WcfCommunicationClientFactory<IPreorders>(binding, null, resolver), serviceName, 1);
try
{
PreOrder po = await c.Get("50", "11001", OrderNumber = "123456" });
Console.WriteLine("done");
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
}
}
}
調査後、サービス内で使用されているトランザクションと関係があるようです。
サービスは決してここに過去
await tx.CommitAsync();
を取得していないサービスでフォルトコード、
await preOrders.GetAsync(tx, d, s, (k, v) => preOrder);
ServiceEventSource.Current.ServiceMessage(this, "after update");
await tx.CommitAsync();
ServiceEventSource.Current.ServiceMessage(this, "after commit");