With the change to .NET 8 in WATS Client 7.0, some changes have been made to the structure of the API .dlls provided for third party support. This guide means to describe the issues discovered during development and testing, and provide a workaround for standalone .exe programs to continue working after WATS Client 7 is installed.
What has changed:
The most notable change for integrators is that Interface.TDM and Interface.MES have been merged into a single WATS Client API dll. This would mean that any existing programs that depended on the old Interface.TDM and Interface.MES .dll files would be unsupported unless a recompilation was made. This was something we did not want, and we decided to create two proxies that aim to provide a way of utilizing the new WATS Client API dll while avoiding the need to recompile and remove the references to Interface.TDM and Interface.MES.
With the move away from .NET Framework, the Global Assembly Cache is also not supported anymore which leads to difficulties when upgrading from a system that is reliant on using the GAC. This means that the workaround described here will require the .dlls to be moved into the same folder as the .exe file.
Workaround:
In order to provide the .exe with the correct assembly version of the updated Interface.TDM/MES proxies, a config file has to be created for your .exe file. This config file is a built-in function of .NET Framework and can be utilized for other configuration changes as well, see more: Configuring Apps by using Configuration Files - .NET Framework | Microsoft Learn
The following configuration file is provided as is, and can be configured as necessary.
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Virinco.WATS.Interface.TDM"
publicKeyToken="25abfe255fd31fdf" />
<bindingRedirect oldVersion="6.0.0.0-6.65535.65535.65535" newVersion="7.0.0.X"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Virinco.WATS.Interface.MES"
publicKeyToken="25abfe255fd31fdf" />
<bindingRedirect oldVersion="6.0.0.0-6.65535.65535.65535" newVersion="7.0.0.X"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8.1" />
</startup>
</configuration>
The name of the configuration file should be "myExeName.exe.config" and needs to be placed alongside the standalone .exe file. The "newVersion" property also needs to be updated to the .dll version you're redirecting to.
Note: A config file is attached to this article and is edited for the WATS Client 7.0 beta version 7.0.130.
WATS Client installs the necessary .dll files in a "Legacy" folder in the Program Files installation folder. The folder path looks like "C:\Program Files\Virinco\WATS\Legacy" on a default, English installation of Windows. This folder should contain 5 .dll files compiled in .NET Framework:
- Newtonsoft.Json.dll
- Virinco.WATS.ClientAPI.dll
- Virinco.WATS.Converters.Standard.dll
- Virinco.WATS.Interface.MES.dll
- Virinco.WATS.Interface.TDM.dll
Copy Newtonsoft.Json.dll and Virinco.WATS.ClientAPI.dll to your .exe file folder, and the relevant .dlls according to your program references.
Below is an example of how this might look like for a program that has a reference to Interface.TDM and Interface.MES:
Comments
0 comments
Please sign in to leave a comment.