Boyum uses the logging platform NLog as part of its logging system. If for some reason a version of NLog is installed into the GAC (Global Assembly Cache), the version of NLog in the GAC will take precedence over any other installed versions. This could cause our applications and services to fail during startup.
When using our add-on and services make sure no third-party software will install NLog into the GAC.
In general, installing NLog into the GAC is a very bad idea as the assembly is strongly named and any software doing this can break unrelated software. From Microsoft:
"As a general guideline, keep assembly dependencies private, and locate assemblies in the application directory unless sharing an assembly is explicitly required. " (Sharing NLog is not explicitly required)
If you find software that installed NLog into the GAC we recommend contacting the developers and asking them to use a local copy of NLog instead of registering NLog in the GAC.
We, unfortunately, cannot work around this as this is how the .NET framework is designed.
Error message example:
System.MissingMethodException: Method not found: 'Void NLog.Targets.FileTarget.set_FileNameKind(NLog.Targets.FilePathKind)'.
at SBO.Logging.Log..ctor(String path)
at SBO.AddonLogic.Addon.InitializeDefaultEventlog(AddonData addonData)
at SBO.AddonLogic.Addon.Start(AddonData addonData, AddonModules addonModules)
Remove NLOG from GAC:
Step 1) Uninstall all programs that are not strictly required. Windows will automatically remove NLog from the GAC when the program using it is uninstalled.
Step 2) If it is still an issue and you cannot figure you what program uses NLog you can remove NLog from the GAC and see if anything fails (This might break the program that installed the .dll to GAC)
You can remove it using the GACViewer: http://www.nirsoft.net/dot_net_tools/gac_viewer.html
First, check if it exists in the default list. If it does not navigate to File -> Select GAC folder
And select the folder: C:\Windows\Microsoft.NET\assembly\GAC_MSIL
Find Nlog and remove it:
After removing Nlog you should be able to get the add-on working.
If you cannot remove the NLog .dll due to errors you will need to use the Gacutil.exe instead (Microsoft tool): https://docs.microsoft.com/en-us/dotnet/framework/tools/gacutil-exe-gac-tool
This requires the .NET SDK to be installed so try with GACViewer first.
Please sign in to leave a comment.