executor://mstestadapter/v2': Could not load file or assembly

Copper Contributor

I'm trying to run native C++ tests using Visual Studio Test task and azure devops on a new build machine. I have 2 build machines that can run the Test task without a problem.

On the new build machine: If I run the tests from within visual studio and everything works as expected. However the task fails with the following log:



============================================================================= C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\Extensions\TestPlatform>vstest.console.exe "c:\agent\_work\1\s\Application\Bin\Release\Cathworks.App.Tests.dll" Microsoft (R) Test Execution Command Line Tool Version 16.11.0 Copyright (c) Microsoft Corporation. All rights reserved. Starting test execution, please wait... A total of 1 test files matched the specified pattern. Test Method = TestCwColorFormats Test Description = Color format conversion test Passed TestCwColorFormats [4 ms] Test Method = AddPointsTest Test Description = Edit vessel: Add points on vessel proximal edge test Passed AddPointsTest [3 ms] Test Method = CutLine1Test Test Description = Edit vessel: Cut points on vessel proximal edge test Test Method = CutLine2Test Test Description = Edit vessel: Cut points on vessel proximal edge test Test Method = CutLine3Test Test Description = Edit vessel: Cut points on vessel proximal edge test Test Method = PrepareInfoForProximalRadiiComputeTest1 Test Description = Checks preparing info for proximal radii computing Test Method = PrepareInfoForProximalRadiiComputeTest2 Test Description = Checks preparing info for proximal radii computing Test Method = PrepareInfoForProximalRadiiComputeTest3 Test Description = Checks preparing info for proximal radii computing Test Method = PrepareInfoForProximalRadiiComputeTest4 Test Description = Checks preparing info for proximal radii computing Test Method = PrepareInfoForProximalRadiiComputeTest5 Test Description = Checks preparing info for proximal radii computing Test Method = PrepareInfoForProximalRadiiComputeTest6 Test Description = Checks preparing info for proximal radii computing Passed CutLine1Test [2 ms] Passed CutLine2Test [3 ms] Passed CutLine3Test [3 ms] Passed PrepareInfoForProximalRadiiComputeTest1 [3 ms] Passed PrepareInfoForProximalRadiiComputeTest2 [2 ms] Passed PrepareInfoForProximalRadiiComputeTest3 [3 ms] Passed PrepareInfoForProximalRadiiComputeTest4 [3 ms] Passed PrepareInfoForProximalRadiiComputeTest5 [2 ms] Passed PrepareInfoForProximalRadiiComputeTest6 [2 ms] Test Method = PrepareInfoForDistalRadiiComputeTest1 Test Description = Checks preparing info for distal radii computing Test Method = PrepareInfoForDistallRadiiComputeTest2 Test Description = Checks preparing info for distal radii computing Test Method = PrepareInfoForDistalRadiiComputeTest3 Test Description = Checks preparing info for distal radii computing Test Method = PrepareInfoForRadiiComputeTestRealCases Test Description = Checks preparing info for radii computing PrepareInfoForRadiiComputeTestInputOutput input_1.mat input_2.mat input_3.mat input_4.mat input_5.mat Test Method = MatchCandidateToMainVesselChangeTest1 Test Description = Checks candidates matching after main vessel change Test Method = MatchCandidateToMainVesselChangeTest2 Test Description = Checks candidates matching after main vessel change Test Method = MatchCandidateToMainVesselChangeTest3 Test Description = Checks candidates matching after main vessel change Test Method = MatchCandidateToMainVesselChangeTest4 Test Description = Checks candidates matching after main vessel change Test Method = FFRVolumeBinsTest Test Description = FFRangio total volume PIE data model calculation Passed PrepareInfoForDistalRadiiComputeTest1 [3 ms] Passed PrepareInfoForDistallRadiiComputeTest2 [2 ms] Passed PrepareInfoForDistalRadiiComputeTest3 [3 ms] Passed PrepareInfoForRadiiComputeTestRealCases [46 ms] Passed MatchCandidateToMainVesselChangeTest1 [327 ms] Passed MatchCandidateToMainVesselChangeTest2 [27 ms] Passed MatchCandidateToMainVesselChangeTest3 [21 ms] Passed MatchCandidateToMainVesselChangeTest4 [16 ms] Passed FFRVolumeBinsTest [< 1 ms] Test Method = LumenCommandUndoAfterEditContourTest Test Description = Checks undo edit contour command LumenCommandUndoAfterEditContourTest IN LumenCommandUndoAfterEditContourTest Out Test Method = RadiiCalculationPreps_test1 Test Description = Prepare inputs for radii calculation task from data file 1 TestRadiiCalculationPrepsInputOutput Test Method = RadiiCalculationPreps_test2 Test Description = Prepare inputs for radii calculation task from data file 2 TestRadiiCalculationPrepsMatlabCall For TestRadiiCalculationPreps caliing matlab functions, average time for one call is -nan(ind) ms For TestRadiiCalculationPreps with only translated functions, average time for one call is -nan(ind) ms tested on 0 cases Test Method = TestMethodGetAvailableProjSelection Test Description = Get the available projection combination for 3D reconstruction Passed LumenCommandUndoAfterEditContourTest [1 s] Passed RadiiCalculationPreps_test1 [< 1 ms] Passed RadiiCalculationPreps_test2 [< 1 ms] Passed TestMethodGetAvailableProjSelection [< 1 ms] An exception occurred while invoking executor 'executor://mstestadapter/v2': Could not load file or assembly 'Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. Strong name validation failed. (Exception from HRESULT: 0x8013141A) Stack trace: at Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.PlatformServiceProvider.get_AdapterTraceLogger() at Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.MSTestExecutor.RunTests(IEnumerable`1 sources, IRunContext runContext, IFrameworkHandle frameworkHandle) at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Execution.RunTestsWithSources.InvokeExecutor(LazyExtension`2 executor, Tuple`2 executorUriExtensionTuple, RunContext runContext, IFrameworkHandle frameworkHandle) at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Execution.BaseRunTests.<>c__DisplayClass48_0.<RunTestInternalWithExecutors>b__0() at Microsoft.VisualStudio.TestPlatform.PlatformAbstractions.PlatformThread.<>c__DisplayClass0_0.<Run>b__0() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at Microsoft.VisualStudio.TestPlatform.PlatformAbstractions.PlatformThread.Run(Action action, PlatformApartmentState apartmentState, Boolean waitForCompletion) at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Execution.BaseRunTests.TryToRunInSTAThread(Action action, Boolean waitForCompletion) at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Execution.BaseRunTests.RunTestInternalWithExecutors(IEnumerable`1 executorUriExtensionMap, Int64 totalTests) Inner exception: Strong name validation failed. (Exception from HRESULT: 0x8013141A) Test Run Failed. Total tests: 24 Passed: 24 Total time: 23.6609 Seconds =============================================================================
1 Reply

@sharpinstincts 

I run into the same problem when setting up a new CI-pipeline with a Test-Project included. Locally on Visual Studio 17.2.6 it runs without error. On Azure Build-Server the same error appears.