Hi Dojo Community,
I am experiencing issues while running a profile load script that sends InterApp messages to the driver. I encounter the following exception:
System.MissingMethodException: Method not found: 'Skyline.DataMiner.Core.DataMinerSystem.Common.IDmsElement Skyline.DataMiner.Core.DataMinerSystem.Common.IDms.GetElementReference(Skyline.DataMiner.Core.DataMinerSystem.Common.DmsElementId)'.
at Skyline.DataMiner.Core.InterAppCalls.Common.InterAppCommunication.Send(IConnection connection, Int32 agentId, Int32 elementId, Int32 parameterId, String value)
at Skyline.DataMiner.Core.InterAppCalls.Common.CallBulk.InterAppCall.Send(IConnection connection, Int32 agentId, Int32 elementId, Int32 parameterId, ISerializer serializer)
at Skyline.DataMiner.Core.InterAppCalls.Common.CallBulk.InterAppCall.Send(IConnection connection, Int32 agentId, Int32 elementId, Int32 parameterId, IEnumerable`1 knownTypes)
My script references, among others, the following DLLs:
C:\Skyline DataMiner\ProtocolScripts\DllImport\skyline.dataminer.core.dataminersystem.common\1.1.2.2\lib\net462\Skyline.DataMiner.Core.DataMinerSystem.Common.dll
C:\Skyline DataMiner\ProtocolScripts\DllImport\skyline.dataminer.core.interappcalls.common\1.1.0.1\lib\net462\Skyline.DataMiner.Core.InterAppCalls.Common.dll
This script works as expected in our staging environment, but not in production. All DLL versions and configurations are identical between both environments.
Has anyone encountered a similar issue or knows what might be causing this? Any insights or suggestions would be greatly appreciated.
Hi Andrea,
After inspecting the scripts and a memory dump of SLAutomation, this script has no issues but it got impacted by another script.
TL;DR: When referencing a NuGet package in an Automation script (either directly or through a transitive dependency), make sure the script does not reference multiple versions of that NuGet. (for more information, refer to Assembly binding Automation scripts).
Otherwise, issues could occur either with that script itself or it could impact the behavior of other scripts.
In this case, the latter happened. Another script was referencing (indirectly) multiple versions of the class library (1.1.3.6 and 1.1.2.2, which is also referenced in the script that experienced the issue).
From the dump I can see that version 1.1.2.2 was not loaded into the AppDomain, which means it could not resolve it when it was needed at run-time. It will have performed a fallback to another version of that assembly. The dump shows that the version it will have loaded instead was version 1.1.1.9. However, that version does not yet contain the GetElementReference method (as this got introduced in version 1.1.2.1), which explains why it threw a MissingMethodException.
To resolve the issue, the script that references multiple versions of class library should be updated so all direct and indirect references point to the same version.
Hi Pedro,
Thank you for investigating and for the help. It is much appreciated.