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
Microsoft_System Application Test Library.app from DVD\Applications\System Application\TestPublish-NAVApp -ServerInstance bc150 -Path "C:\temp\Microsoft_System Application Test Library.app" -SkipVerificationThe 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:
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.
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