簡體   English   中英

解決Fabric Client時解決Service Pack的VSTS中集成測試失敗的建議

[英]Suggestions to resolve integration tests failure in VSTS for Service Fabric, while acessing Fabric Client

我有一個簡單的測試

public void TestCertificateThumbprint()
        {
            var xc = GetCredentials(this.clientCertThumb, this.serverCertThumb, this.commonName);
            var fc = new FabricClient(xc, this.connection);

        try
        {
            var ret = fc.ClusterManager.GetClusterManifestAsync().Result;
            Assert.IsNotNull(ret);
        }
        catch (Exception e)
        {
            Console.WriteLine("Connect failed: {0}", e.Message);
            Assert.IsNull(e);
        }

        Assert.IsTrue(true);
    }

我沒有遇到從本地而是通過VSTS針對雲中的Azure集群運行此測試的問題,遇到了問題

測試方法TestCertificateThumbprint拋出異常:

System.BadImageFormatException: Could not load file or assembly 'System.Fabric, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. An attempt was made to load a program with an incorrect format.

我已經檢查了版本,它們是有效的,並且已在VSTS的nuget restore構建任務中獲取(基於日志文件控制台輸出)

環境:VS 2017,Azure服務結構,單元測試,程序包:Microsoft.ServiceFabric.6.0.232

確保您的項目針對x64,因為所有Service Fabric程序集都被編譯為x64,並且Azure Service Fabric僅支持x64平台。

請參閱下面的SO鏈接以獲取更多信息。

服務結構System.BadImageFormatException

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM