Sitting here at the airport in Copenhagen with my laptop waiting for my ride home to Iceland.

I wanted to write about a topic that I did not hear or see in Directions during this week.  Windows Client add-ins are now automatically downloaded from the server to the client if they are needed.

A fellow MVP Arend-Jan has already blogged about this but I want to explain a little bit more.

There are a few rules to follow to make sure that this works.  First is the assembly name.  The assembly name must be “Microsoft.Dynamics.Nav.Client.<Class Name>” if the server is supposed to find it.

AssemblyName

Put each new assembly in a dedicated folder in the server add-ins folder.  If other components are needed for this assembly then put them in the same folder.  The server will copy the whole folder to the client.

UserHelperFolder

In the Developement Environment make sure that your server is selected in Tools-Options.

DevToolsOptions

Then when looking for an assembly a new option is to look in the server add-ins folder.

AssemblyLookup

Adding an assembly into your code to run at the client will now work without any further actions.

HelperClassInTable370

And now – when I print to Excel the new Excel window opens in front of Dynamics NAV 2015.

iExcelInFront

 

To quote Microsoft directly:

“Automatic Deployment of Microsoft .NET Framework Interoperability and Control Add-in Assemblies

Microsoft Dynamics NAV 2015 makes it easier for the system administrators to deploy client-side assemblies for .NET Framework interoperability and client control add-ins on computers that are running the Microsoft Dynamics NAV Windows client or Microsoft Dynamics NAV Development Environment. You can now install the assemblies in the Add-ins folder on the computer that is running Microsoft Dynamics NAV Server. By default, this is the C:\Program Files\Microsoft Dynamics NAV\80\Service\Add-ins folder. When an operation from the client requires an assembly, Microsoft Dynamics NAV Server automatically deploys the assembly to a temporary folder on the client computer.

For example, if Microsoft Dynamics NAV Windows client opens a page that contains a control add-in, Microsoft Dynamics NAV Server will find the control add-in assembly by name in the Add-ins folder. Then, it deploys the assembly to the client computer in the %TEMP%\Microsoft Dynamics NAV\Add-Ins folder of user who is running the client. Subsequently, the deployed assembly will be used whenever the page is opened.

Similarly, if the development environment requires a control add-in, for example, when you compile an object, then the control add-in assembly will be deployed by the Microsoft Dynamics NAV Server to the local temporary folder for the current user on the computer that is running the development environment.

Note
To be deployed, an assembly must comply with the following Microsoft Dynamics NAV Server configuration settings: Chuck Size, Max Upload Size, and Prohibited File Types.

If a .NET Framework interoperability or control add-in assembly is updated and its version number changes, Microsoft Dynamics NAV Server will deploy the updated assembly to the client computer the next time that the client requests the assembly. The updated assembly is put in a subfolder of the %TEMP%\Microsoft Dynamics NAV\Add-Ins folder, where the subfolder has the assembly’s version number as its name. This implementation means that you do have to remove the older versions of assemblies that are stored on the client computer.

To support compatibility with earlier version of Microsoft Dynamics NAV, before Microsoft Dynamics NAV Server deploys an assembly to a client, the client looks for the assembly in the local Add-ins folder (for example, C:\Program Files (x86)\Microsoft Dynamics NAV\80\RoleTailored Client\Add-ins). If the assembly is not found, then the client will request the assembly from Microsoft Dynamics NAV Server. Javascript-based client add-ins have been using this deployment technique since Microsoft Dynamics NAV 2013 R2.”

7 thoughts on “Automatic Deployment of Microsoft .NET Framework Interoperability and Control Add-in Assemblies in NAV 2015

  1. ptijsma says:

    Hi Gunnar, first of all, thanks for some more clarification, but I must make a comment on the naming.

    You’re stating the following: “The assembly name must be “Microsoft.Dynamics.Nav.Client.” if the server is supposed to find it”

    This is not true. Just wanted to confirm this with one of my own Add-ins and it also finds it with a different name. Mine for example is called “NovaVision.PrintVis.WcfClient” and thus doesn’t follow the name as you mention. Furthermore, the Namespace used in my assembly differs from the Assembly name.

    The assembly, as listed in the variable declaration, is listed as “NovaVision.PrintVis.CloudClient.WCFClientOnPremise.’NovaVision.PrintVis.WcfClient, Version=8.0.0.0, Culture=neutral, PublicKeyToken=df97a45b18e41732′”

    So to summarize:
    – Assembly Name: NovaVision.PrintVis.WcfClient
    – Namespace: NovaVision.PrintVis.CloudClient
    – Classname: WCFClientOnPremise

    I’ve removed the assembly from my Client Add-ins folder, removed from the %TEMP%\Microsoft Dynamics NAV\Add-Ins\ folder and made sure it only exists in its own folder in the Service\Add-ins folder

    The moment I start the code that uses this assembly, I can see it’s being copied to the client and utilized without issues.

    I must say I’m puzzled, because I also thought it was important to keep the naming aligned, but perhaps this is only the case for Control Add-ins as used on pages because they need a “ControlAddInExport” attribute?

    Thanks,

    1. Taddeo says:

      Hello this used to work fin but in NAV 2017 doesn’t work anymore?

  2. Jason Down says:

    Gunnar, do you know if this is only available in NAV 2015? We’re currently running NAV 2013 R2 (plans to upgrade next year), but this would be quite handy to have, since we have quite a few in-house add-ins we use for our clients.

    PS – It was great to meet you in Antwerp (I was one of the guys Snorri introduced you to from Home Hardware).

    Thanks

    1. Hi Jason.
      Antwerp was a great fun.
      This feature has not been introduced in NAV 2013 R2 and I do not expect that it will be.

      1. Jason Down says:

        Ok, thanks again Gunnar.

  3. Peter says:

    To Update a Control Addin, you need to change the Version Number in the Control Add-ins and in the dll file.

Leave a Reply

%d bloggers like this: