Equisys technical notes

Technical guidance, explanations and fixes for our products

PRB: An error occured while creating the add-in control for "Equisys Zetadocs CaptureAddin, PublicKeyToken..." in Factbox

Print

ZTN4559

This Zetadocs technical note applies to:

  • Zetadocs Delivery and Capture version 11.1 and older
  • NAV 2018, Business Central 14 and older versions
  • Windows 10

Symptom

After installing Zetadocs for NAV on a client with Windows 10, the factbox shows the following error:

Image

Zetadocs cannot load the factbox and the following error is shown when opening a page with the factbox:

"Could not load file or assembly "Unity.Abstractions""

Image

Cause

This is caused by a 3rd party software that has added to the GAC folder one of the Unity.Container dll that Zetadocs uses, but it hasn't added the dependency of this dll, Unity.Abstraction. As the Unity.Container is in the GAC, windows searches for the Unity.Abstraction into the GAC as well and does not search into the Zetadocs folder anymore, leading to the dll being not found and the error seen.

The GAC folder is usually located in C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Unity.Container\v4.0_5.11.8.0__489b6a ccfaf20ef0.

Resolution

Running the following Snippet in PowerShell will add the Unity.Abstraction.dll into the GAC alongside the Unity.Container.dll. Making sure to replace the dllPath value with the location of you Unity.Abstraction.dll, the dll can be found in the ZetadocsControAddinFull folder which is in your RoleTailored Client Add-ins install folder for example:
"C:\Program Files (x86)\Microsoft Dynamics NAV\110\RoleTailored Client\Add-ins\ZetadocsCaptureAddinFull\Unity.Abstractions.dll"

 $dllpath = "C:\Program Files (x86)\Microsoft Dynamics NAV\110\RoleTailored Client\Add-ins\ZetadocsCaptureAddinFull\Unity.Abstractions.dll" 
 
 [System.Reflection.Assembly]::Load("System.EnterpriseServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a") 
 
 $publish = New-Object System.EnterpriseServices.Internal.Publish 
 
 $publish.GacInstall($dllpath) 

Status

Solved with the workaround described in the Resolution

Last updated: 19th August 2022 (EG/MP) 

Keywords: Client, Control Addin, The system cannot find the file specified, GAC

Equisys Logo, Document Management and Expense Management for Business Central
 

Replaced by script