Skip to main content
Run Visual Studio Test task in 64bit
  1. Posts/

Run Visual Studio Test task in 64bit

·132 words·1 min
Christoph Petersen
Author
Christoph Petersen

All of our managed assemblies are build with the any cpu target and we can use both the 32-bit and 64-bit task runner of Azure Pipelines.

One of our projects uses a C++ DLL that is either in 32-bit or 64-bit and we need a specific test runner (the 64-bit one to be exact) to not fail with a System.BadImageFormatExeption.

By default the Visual Studio test runner will start a 32-bit process. If you need to use the 64-bit version you need to specify extra arguments with supplying otherConsoleOptions to the task:

- task: VSTest@2
  displayName: Run tests
  inputs:
    testAssemblyVer2: |
      **\bin\$(BuildConfiguration)\**\*Test.dll
      !**\obj\**
      !**\xunit.runner.visualstudio.testadapter.dll
      !**\xunit.runner.visualstudio.dotnetcore.testadapter.dll
    runTestsInIsolation: true
    codeCoverageEnabled: true
    otherConsoleOptions: '/Platform:x64'

Note: The Visual Studio Test task sports a parameter called platformwhich does not change the architecture of the test runner executable.

Related

Use Azure Artifacts outside of Visual Studio

·438 words·3 mins
One of the major tasks since starting at HorseAnalytics has been to streamline our development efforts. Centralize the codebase on Azure Repos, refactor the code so that it can not only be built on Windows but also on other platforms like Mac OS.

Download images with RestSharp

·143 words·1 min
We are using RestSharp for functional testing of our backend services. As part of this process we need to upload images and compare the uploaded bytes against the expected result.

Fetching all branches and tags from a remote Git repository

·164 words·1 min
In my first days at HorseAnalytics, one of the first tasks was to review the codebase and streamline the build and release process. That meant to move all repositories over to Azure DevOps so that we can use the pipelines to build and release new versions of our products.