Saturday, December 8, 2018

How to Install a Windows Client Control Add-in Assembly (Dynamics NAV)

How to Install a Windows Client Control Add-in Assembly (Dynamics NAV)

Windows Client Control Add-ins in Microsoft Dynamics NAV are delivered as .NET Framework–based assemblies (.dll files). To use a control add-in in the NAV Windows (RoleTailored) Client, the corresponding assembly must be available on the computer where the client is running.

In certain development scenarios—such as compiling objects that reference a control add-in—the assembly must also be installed on the machine running the NAV Development Environment.


Installation Options for Control Add-ins

Control add-in assemblies can be installed using two main approaches:

  1. Manual installation on the NAV Windows Client or Development Environment

  2. Automatic deployment via the NAV Server or database

Each approach has different use cases, explained below.


Option 1: Manual Installation on the NAV Windows Client

This method is useful for:

  • Development and testing

  • Environments without NAV Server access

  • Troubleshooting add-in loading issues

Steps:

  1. On the computer running the NAV Windows Client, copy the control add-in .dll files.

  2. Paste them into the Add-ins folder of the NAV client installation.

Default path:

C:\Program Files (x86)\Microsoft Dynamics NAV\100\RoleTailored Client\Add-ins

Note:
You can place assemblies inside subfolders within the Add-ins directory. This is recommended when working with multiple add-ins or dependencies.

Once copied, the control add-in becomes immediately available to the client.


Option 2: Automatic Deployment of Control Add-ins (Recommended)

NAV supports automatic deployment of control add-ins when:

  • The control add-in name matches the assembly name

  • The assembly complies with NAV Server configuration limits (chunk size, upload size, allowed file types)

With automatic deployment, assemblies are centrally managed and deployed to clients as needed.


How Automatic Deployment Works

When a NAV Windows Client requires a control add-in (for example, when opening a page that uses it), the following sequence occurs:

  1. The client checks its local Add-ins folder:

    C:\Program Files (x86)\Microsoft Dynamics NAV\100\RoleTailored Client\Add-ins
  2. If the assembly exists locally, it is used immediately.

  3. If not found, the client requests the add-in from the NAV Server.

  4. The NAV Server checks its own Add-ins folder:

    C:\Program Files\Microsoft Dynamics NAV\110\Service\Add-ins
  5. If found, the server deploys the assembly to the client.

  6. If not found on the server, the assembly is retrieved from the NAV database.

  7. The assembly is then deployed to the client’s temporary folder:

    %TEMP%\Microsoft Dynamics NAV\Add-Ins

The deployed assembly remains available until a newer version is detected.


Version Updates and Add-in Caching

  • If the control add-in assembly is updated and its version number changes, NAV Server automatically deploys the new version.

  • Each version is stored in a separate subfolder under:

    %TEMP%\Microsoft Dynamics NAV\Add-Ins
  • Older versions are not automatically removed, but they are no longer used once a newer version is deployed.

This mechanism ensures version safety without impacting running clients.


Control Add-ins in the Development Environment

When compiling objects that reference control add-ins:

  • The development environment follows the same deployment logic

  • The required assembly is deployed to the current user’s temporary folder

This allows compilation and testing without manual copying.


Installing Control Add-ins on the NAV Server

To enable automatic deployment via the server:

  1. Copy the control add-in assembly to:

    C:\Program Files\Microsoft Dynamics NAV\110\Service\Add-ins
  2. Restart the NAV Server service if required.

This makes the add-in available to all clients connected to that server instance.


Importing Control Add-ins into the Database

This method is useful for:

  • Centralised deployment

  • Multi-server environments

  • Controlled version management

Steps:

  1. Create a .zip file containing the control add-in assemblies in the desired folder structure.

  2. In Dynamics NAV, search for Control Add-ins.

  3. Choose New.

  4. Enter:

    • Control Add-in Name

    • Public Key Token

  5. Choose Import and select the .zip file.

  6. Confirm and close the page.

The control add-in is now stored in the database and deployed automatically when required.


PowerShell-Based Management (Optional)

Control add-ins can also be managed using the NAV Administration Shell:

  • New-NAVAddin

  • Set-NAVAddin

  • Get-NAVAddin

  • Remove-NAVAddin

This is especially useful for scripted deployments and automation.


Summary

Windows Client Control Add-ins in NAV can be installed manually or deployed automatically via the server or database. Automatic deployment is the preferred approach for production environments, while manual installation is often used during development and troubleshooting.

Understanding how NAV locates, deploys, caches, and updates control add-ins is essential when performing upgrades, troubleshooting client issues, or transitioning legacy solutions.

No comments:

Post a Comment

Business Central SaaS Extension Design: Implementing Plant Tracking with AL Event Subscribers

  Extending Business Central SaaS: Plant Tracking Using AL Extensions  1️⃣ Problem Statement In many manufacturing and service-oriented or...