Add-Ins in Dynamics NAV 2013 - Loading of NAV R2 AddIns in NAV 2013
Dynamics NAV 2013 appears at the horizon. Selected partners have received already many builds and a Beta has been released to partners. There are going to be some really powerful new capabilities available in NAV 2013, which I will blog about in the near future. But let’s start with one piece of information: How to use AddIns from NAV 2009 R2 in NAV 2013.
From the first design of AddIns for NAV R2 we had taken care of the fact that AddIns that have been built for R2 (DataBinding with Text, BigText or Blob) and the OnControladdIn trigger we had planned that AddIns built for a previous version would also load in the next versions of NAV. From the internal interface and implementation perspective this also supported in the design.
The only remaining tweak to make this work is to tell the .NET system that it is shall load AddIns built for R2 and bind them against the newer versions of the libraries Microsoft.Dynamics.Framework.UI.Extensibility and Microsoft.Dynamics.Framework.UI.WinForms.Controls. This is done by a configuration entry in the config file for the Role Tailored client (Microsoft.Dynamics.Nav.Client.exe.config):
<runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="Microsoft.Dynamics.Framework.UI.Extensibility" publicKeyToken="31bf3856ad364e35" culture="neutral"/> <bindingRedirect oldVersion="0.0.0.0-184.108.40.206" newVersion="220.127.116.11"/> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="Microsoft.Dynamics.Framework.UI.WinForms.Controls" publicKeyToken="31bf3856ad364e35" culture="neutral"/> <bindingRedirect oldVersion="0.0.0.0-18.104.22.168" newVersion="22.214.171.124"/> </dependentAssembly> </assemblyBinding> </runtime>
This configuration will instruct the .NET runtime to use the version 7.0 of the Extensibility assembly if a library that gets loaded has been compiled against an earlier version. The same for the version 1.5 of the WinForms.Controls assembly which is needed indirectly too.
Please note: In released NAV 2013 this settings will probably ship in the standard configuration file.
But in order to allow the page previewer in NAV 2013 development environment also to show R2 AddIns and to allow .NET interop components from the same AddIn assembly to be used in the NAV development environment and on the server at runtime, you will need to ad the same settings to the respective config files for finsqle.exe and the service executable Microsoft.Dynamics.Nav.Server.exe.
While in general it is a good idea to use of serializable .NET interop objects for data models for communication with more complex AddIns, like business data visualizations, I strongly suggest to not blend those data model objects into the AddIn assembly but keep them as separate assemblies without any dependencies to NAV product libraries.
Senior Program Manager
Microsoft Dynamics NAV