web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Unit tests execution from build pipeline problem

(1) ShareShare
ReportReport
Posted on by 12
Hi guys,
I have a build pipeline in our Azure DevOps, where Unit tests execution is included as a final step.
 
taskVSTest@2
  displayName'Execute Tests'
  inputs:
    testAssemblyVer2'$(TestAssembly)'
    # searchFolder: '$(Agent.BuildDirectory)\Bin\'
    searchFolder'$(Build.BinariesDirectory)\CSIEAutomatedTestsSuite\Bin\'
    testFiltercriteria'$(TestFilter)'
    vsTestVersion17.0
    runInParallelfalse
    codeCoverageEnabledtrue
    #otherConsoleOptions: '/Platform:X64 /InIsolation /TestAdapterPath:"$(VsixExtensionFolder)"'
    otherConsoleOptions'/Platform:X64 /InIsolation'
    testRunTitle'Unit Test - $(Build.DefinitionName)'
    platform'$(BuildPlatform)'
    configuration'$(BuildConfiguration)'
    continueOnErrortrue
 
This task resulted in a following error:
 
An exception occurred while invoking executor 'executor://systestexecutor/v1': 
Could not load file or assembly 'Microsoft.Dynamics.AX.Framework.SysTest, Version=7.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
 
It is self-hosted agent on a VM where 'Microsoft.Dynamics.AX.Framework.SysTest' obviously installed in a C:\AOSService\PackagesLocalDirectory\bin
 
Could somebody point me what might be wrong?
 
Categories:
I have the same question (0)
  • Suggested answer
    Assisted by AI
    ANInnoSolutions Profile Picture
    446 on at
    Hi Jay Dev,
     
    1) Issue
    - Unit test execution in Azure DevOps pipeline fails during VSTest step
    - Error message states that assembly 'Microsoft.Dynamics.AX.Framework.SysTest' cannot be loaded
    - The assembly exists on the self hosted agent under C:\AOSService\PackagesLocalDirectory\bin
    - Tests are not executed because the SysTestExecutor cannot resolve required dependencies
    - The issue blocks automated test execution in CI pipeline
     
    2) Reason
    - The error is caused by the test execution environment not resolving Dynamics 365 Finance assemblies at runtime
    - VSTest does not automatically include AOSService binary paths in the probing path for test execution
    - A required dependency (Microsoft.Dynamics.AX.Framework.SysTest) is not found in the test working directory or search path
    - This leads to a failure when the SysTestExecutor tries to initialize and load AX test framework assemblies
    - This can happen because the build agent environment is not configured like a full D365 runtime environment (missing PATH / binding context / probing paths)
     
    3) Resolution
    - Copy required AX assemblies (including Microsoft.Dynamics.AX.Framework.SysTest and dependencies) into the test binaries folder before running VSTest
    - Alternatively extend the PATH or use a runsettings file to include probing paths pointing to C:\AOSService\PackagesLocalDirectory\bin
    - Ensure that the test adapter and SysTest framework DLLs are available in the same directory as the test assemblies
    - Use TestAdapterPath parameter to explicitly point to the AX SysTest adapter if required
    - Validate that the correct platform (x64) and isolation settings are used as already configured
    - Run tests locally on the agent VM using vstest.console to confirm environment setup outside pipeline
    - Ensure that the service account running the agent has access to the AOSService folder
    - Consider packaging test execution within a deployable package or use a build VM image that includes the full D365 runtime
    - If needed create a pre step in the pipeline to prepare the AX runtime context before test execution
    *When modifying specific path objects, please note that missing or a higher amount of objects can cause inconsistencies during execution times
     
    For a more detailed answer, please provide more information.
     

    Rg,

    Alexander

    *Due to the complex and different possibilities of deploying Dynamics 365 I highly recommend not to setup the application without some expert/partner or support. (For more information contact me under anassl@inno-solutions.info or visit www.inno-solutions.de)

    *The Information comes directly from the manufacturer or provider and are validated (not guaranteed) up to date of creation of the posting.

    References:

    1. Microsoft Licensing Guide
    2. Microsoft Doc`s/Learn
  • Subra Profile Picture
    456 on at
    Hi Jay,

    Could you please let me know which version you are using in D365 and please make sure you have checked-in all the required files.
     
    Thanks,
    Subra

     
  • Deepak Agarwal Profile Picture
    8,791 on at
    Hey Jay, 
     
    This type of error generally come when in your development  you miss a model dependency. I am not entirely sure on your case though. Is there any development done as part of testing? Also are you getting same error on all environment or specific environment. 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 622

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 553 Super User 2026 Season 1

#3
CP04-islander Profile Picture

CP04-islander 430

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans