microsoft / vstest

Visual Studio Test Platform is the runner and engine that powers test explorer and vstest.console.
MIT License
869 stars 316 forks source link

TRX file generated but with no test results - Solution on how to fix the version mismatch in VSTEST@2 in Azure classic version #5009

Open purnravip opened 2 months ago

purnravip commented 2 months ago

Dear Sir/Madam,

Thank you for the update. After switching to vstest2, it successfully detected the latest Visual Studio 2019 Enterprise version, and the trx file is now generated. However, the trx file references vstest.console.exe and displays the following paths:

"D:\Agents\V2\2.126.0_work\xxxx\s\xxx.Tests.UnitTests\bin\Release\xxxx.Common.Tests.dll" "D:\Agents\V2\2.126.0_work\xxxx\s\xxxx.Tests.UnitTests\bin\Release\xxxx.Tests.UnitTests.dll" /EnableCodeCoverage /logger:"trx" Upon initiating the test execution, I encountered the following message:

Test run detected DLL(s) which were built for different framework and platform versions. Following DLL(s) do not match current settings, which are .NETFramework,Version=v4.7.2 framework and X86 platform. xxxx.Common.Tests.dll is built for Framework .NETFramework,Version=v4.5.1 and Platform AnyCPU

Additionally, the trx file indicates that no test cases were found and here is the below info from the trx file:

No test is available in D:\Agents\V2\2.126.0\_work\xxxx\s\xxxx.Tests.UnitTests\bin\Release\xxxx.Common.Tests.dll D:\Agents\V2\2.126.0\_work\xxxx\s\xxxx.Tests.UnitTests\bin\Release\xxxx.Tests.UnitTests.dll. Make sure that test discoverer & executors are registered and platform & framework version settings are appropriate and try again. It appears that the test discoverer and executors may not be registered correctly, and the platform and framework version settings might need adjustment. Please let us know where to update and point in VSTEST2 task which is part our Azure build pipeline through classic version.