azure-pipelines-tasks: VSTest@2: Unable to test .NET 6, vstest.console not found
Required Information
Entering this information will route you directly to the right team and expedite traction.
Question, Bug, or Feature?
Type: Bug
Enter Task Name: VsTestV2
Environment
-
Azure Pipelines
-
Agent - Hosted: vmImage: ‘windows-2022’
Issue Description
I want to upgrade my .NET 5 solution to .NET 6. After every thing works local (VS 2022 Enterprise) I tried to run our Azure Pipeline which builds, tests and publishes the application. After switching the host from “windows-latest” to “windows-2022” the solution could be build with the pipeline, but the tests could not be executed:
… unable to find vstest.console from a visual studio installation …
I just found a commit “VsTest task changes to support 2022”, but it seems, that this update is no available in the pipelines yet?
- task: VSTest@2
displayName: 'Run tests & publish results"'
inputs:
testRunTitle: 'Hardware Independent'
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
testAssemblyVer2: '$(testDll)'
codeCoverageEnabled: true
runInParallel: true
rerunFailedTests: true
rerunMaxAttempts: 3
testFiltercriteria: 'TestCategory~hardware independent'
Task logs
Starting: Run tests & publish results"
==============================================================================
Task : Visual Studio Test
Description : Run unit and functional tests (Selenium, Appium, Coded UI test, etc.) using the Visual Studio Test (VsTest) runner. Test frameworks that have a Visual Studio test adapter such as MsTest, xUnit, NUnit, Chutzpah (for JavaScript tests using QUnit, Mocha and Jasmine), etc. can be run. Tests can be distributed on multiple agents using this task (version 2).
Version : 2.170.1
Author : Microsoft Corporation
Help : https://docs.microsoft.com/azure/devops/pipelines/tasks/test/vstest
==============================================================================
SystemVssConnection exists true
SystemVssConnection exists true
Running tests using vstest.console.exe runner.
======================================================
Test selector : Test assemblies
Test filter criteria : TestCategory~hardware independent
Search folder : D:\a\1\s
Action when minimum tests threshold not met : donothing
Minimum tests expected to be run: 0
VisualStudio version selected for test execution : 16.0
Attempting to find vstest.console from a visual studio installation with version [15.0,17.0).
Attempting to find vstest.console from a visual studio build tools installation with version [15.0,17.0).
##[error]Error: Visual Studio NaN is not found. Try again with a version that exists on your build agent machine.
Finishing: Run tests & publish results"
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 6
- Comments: 20 (4 by maintainers)
I didn’t do anything. The vstest task version just changed:
But now, I have other problem:
Obviously, there aren’t any netframework x86 dll in my test project. 🥲
I just kicked a new pipeline run again and we’re still getting
2.170.1
. Our task is just requiringVSTest@2
, so not sure why we seem to be getting a different version that you are 🤔Our builds are still getting task version 2.170.1 and the task fails if I try to specify 2.195.0 . @ejszi , how did you get the new version of the task to run?
With 2.195.0 task version, it’s resolved. Thanks!
@MatthewSteeples wasn’t resolved. Version of the image is 20211109.2 but version of the task is still
Version : 2.170.1