[英]Suggestions to resolve integration tests failure in VSTS for Service Fabric, while acessing Fabric Client
I have a Simple test 我有一个简单的测试
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);
}
I encountered no issues running this test against azure cluster in cloud from my local but through VSTS, running into Issues 我没有遇到从本地而是通过VSTS针对云中的Azure集群运行此测试的问题,遇到了问题
Test method TestCertificateThumbprint threw exception: 测试方法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.
I have checked the versions, They are valid and they are fetched in the nuget restore build task of VSTS ( based on log file console output) 我已经检查了版本,它们是有效的,并且已在VSTS的nuget restore构建任务中获取(基于日志文件控制台输出)
Environment: VS 2017, Azure Service Fabric, Unit tests, Package : Microsoft.ServiceFabric.6.0.232 环境:VS 2017,Azure服务结构,单元测试,程序包:Microsoft.ServiceFabric.6.0.232
Make sure that your project is targeting x64 as all Service Fabric assemblies are compiled to x64 and Azure Service Fabric only supports x64 platform. 确保您的项目针对x64,因为所有Service Fabric程序集都被编译为x64,并且Azure Service Fabric仅支持x64平台。
Refer the below SO link for more information. 请参阅下面的SO链接以获取更多信息。
Service Fabric System.BadImageFormatException 服务结构System.BadImageFormatException
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.