.net library 2018 PU2 Version Woes

SUGGESTED

I am posting this as a potential issue for others.

In PU2 Sage in all their wisdom have decided to....

Bump the version number of \HKLM\SOFTWARE\WOW6432Node\ACCPAC International, Inc.\ACCPAC\Web\A4WNET to 6.5.0.2 but not keep this in step with the .net runtime library version (6.5.0.10). This has broken 8 versions of Sage300 where the two have been in step.

Why is this a problem? The .net assemblies are loaded into the GAC and to avoid having to recompile/re-release your application after version update we use reflection to load the assemblies.

Prior to this update we could use System.Reflection.Assembly.Load([full assembly signature]). However, to use this method we need to know the version of the S300 runtime assembly (Accpac.Advantage.dll), which we obtained by querying the registry.

To work around the issue we now use the System.Reflection.Assembly.LoadFile method. This is fine, but it does bypass the checks the .net assembly loader does when calling Load.

const string SAGE_RUNTIME = "Sage\\Sage 300 ERP\\ACCPAC.Advantage.dll";

Assembly ass = Assembly.LoadFile(System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonProgramFilesX86), SAGE_RUNTIME));


Hope this helps others.