xUnit测试在TC上失败,无法找到程序集'Microsoft.WindowsAzure.Storage

时间:2018-08-08 11:23:24

标签: teamcity xunit

我有仅在TC上失败的xUnit测试(我可以在VS 2017中本地成功运行它)。 完整的异常消息如下:

  

System.Runtime.Serialization.SerializationException: Unable to find assembly 'Microsoft.WindowsAzure.Storage, Version=6.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. [11:25:03][Testing SharedServices.Tests.dll] at System.Runtime.Serialization.Formatters.Binary.BinaryAssemblyInfo.GetAssembly() [11:25:03][Testing SharedServices.Tests.dll] at System.Runtime.Serialization.Formatters.Binary.ObjectReader.GetType(BinaryAssemblyInfo assemblyInfo, String name) [11:25:03][Testing SharedServices.Tests.dll] at System.Runtime.Serialization.Formatters.Binary.ObjectMap..ctor(String objectName, String[] memberNames, BinaryTypeEnum[] binaryTypeEnumA, Object[] typeInformationA, Int32[] memberAssemIds, ObjectReader objectReader, Int32 objectId, BinaryAssemblyInfo assemblyInfo, SizedArray assemIdToAssemblyTable) [11:25:03][Testing SharedServices.Tests.dll] at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadObjectWithMapTyped(BinaryObjectWithMapTyped record) [11:25:03][Testing SharedServices.Tests.dll] at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.Run() [11:25:03][Testing SharedServices.Tests.dll] at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage) [11:25:03][Testing SharedServices.Tests.dll] at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage) [11:25:03][Testing SharedServices.Tests.dll] at System.Runtime.Remoting.Channels.CrossAppDomainSerializer.DeserializeObject(MemoryStream stm) [11:25:03][Testing SharedServices.Tests.dll] at System.AppDomain.Deserialize(Byte[] blob) [11:25:03][Testing SharedServices.Tests.dll] at System.AppDomain.UnmarshalObject(Byte[] blob)

我尝试使用xUnit控制台运行器在TC上手动执行测试dll,但仍然出现相同的异常:

64位运行程序:

C:\BuildAgent\tools\xunit-runner\bin\2.0.0\xunit.console.exe C:\BuildAgent\work\ba34c42088193a39\tests\bin\Release\SharedServices.Tests.dll

我尝试在x86版本的跑步者上运行相同的游戏

C:\BuildAgent\tools\xunit-runner\bin\2.0.0\xunit.console.x86.exe C:\BuildAgent\work\ba34c42088193a39\tests\bin\Release\SharedServices.Tests.dll

但是在两种情况下结果都是相同的。

我可以确认'Microsoft.WindowsAzure.Storage, Version=6.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'文件夹下存在C:\BuildAgent\work\ba34c42088193a39\tests\bin\Release dll。

我不知道该尝试什么,有什么线索为什么会发生?

0 个答案:

没有答案