Al: An assembly named 'MockTest' not found

Created on 10 Dec 2019  路  2Comments  路  Source: microsoft/AL

The bug
I try to publish Microsoft_System Application Test Library.app to my single tenant but I get the error that An assembly named 'MockTest,' is not found.

To Reproduce

  1. Publish Microsoft_System Application Test Library.app from DVD\Applications\System Application\Test
  2. Publish using the command:
    Publish-NAVApp -ServerInstance bc150 -Path "C:\temp\Microsoft_System Application Test Library.app" -SkipVerification

The error

Publish-NAVApp : Extension compilation failed
DotNet%20Aliases/src/dotnet.al(8,14): error AL0451: An assembly named 'MockTest, PublicKeyToken=null' could not be found in the assembly probing paths 'C:\Program Files\Microsoft Dynamics 365 Business Central\150\Service\Add-Ins
, C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Temp\Microsoft Dynamics NAV\Add-Ins\15.0.37898.0, C:\Program Files\Microsoft Dynamics 365 Business Central\150\Service\, C:\WINDOWS\Microsoft.NET\assembly\'
At line:1 char:1
+ Publish-NAVApp -ServerInstance bc150 -Path "C:\Users\gregor.soln\Docu ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [Publish-NAVApp], InvalidOperationException
    + FullyQualifiedErrorId : MicrosoftDynamicsNavServer$bc150/nav-systemapplication,Microsoft.Dynamics.Nav.Apps.Management.Cmdlets.PublishNavApp

Other information
I tried to build and publish System Application Test Library from VSC where I get the same error.

Screenshot
The problem is in dotnet, why I am not sure. Do I have to install any components?
https://ibb.co/6nd757t

These are my probpaths in VSC json settings:

    "al.assemblyProbingPaths": [
        "C:\\Program Files\\Microsoft Dynamics 365 Business Central\\150",
        "C:\\Program Files (x86)\\Microsoft Dynamics 365 Business Central\\150",
        "C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2",
        "C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\WindowsPowerShell",
        "C:\\Windows\\assembly"
    ], 

I never got any error like that before and I can't find what could solve it.

Versions:

  • AL Language: 4.0194000
  • Business Central: Wave2, v15, CU1
input-needed

Most helpful comment

You need to place MockTest.dll in the server folder (add-ins) and under one of the probing paths
You can find the assembly on the DVD under Test Assemblies\Mock Assemblies

All 2 comments

You need to place MockTest.dll in the server folder (add-ins) and under one of the probing paths
You can find the assembly on the DVD under Test Assemblies\Mock Assemblies

Thank you very much @nikolakukrika for this hint.

Was this page helpful?
0 / 5 - 0 ratings