Hi,
I've got another assembly load issue with an adhoc datasource, we are running 10.5.7. in the adhoc datasource i include an custom nuget which handles dom lookups etc. Part of this nuget is that when linking to an resource it will fetch that resource so we can access that directly. I think that that is where the issue lies since i can do all thing with the nuget until i try to fetch an resources name.
In the nuget we reference Skyline.DataMiner.Core.SRM version 2.0.1 however when i look in error log from the adhoc datasource i do get the following error:
Error in implementation of GetNextPage
System.IO.FileNotFoundException: Could not load file or assembly 'SLManagedAutomation, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
File name: 'SLManagedAutomation, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'
at Skyline.DataMiner.Core.SRM.SrmManagers.get_Default()
at RBM.DataMiner.DOM.Converters.SectionExtensions.GetValue(Section section, FieldDescriptorID fieldDescriptorID, Func`2 messageHandler, Resource& field)
at RBMTielines.Get_nodes()
at RBMTielines.GetNextPage(GetNextPageInputArgs args)
at GQI.ExtensionsWorker.Automation.Extensions.DataSourceWrapper.GetNextPage(IGQIDataSource implementation)
Looking in the dmapp that got created this SRM nuget is not included so i assume it will be included by SRM install itself.
How can i fix this?
Hi Gerwin,
The issue is that 'SrmManagers.Default' attaches to the static 'Engine.SLNet' connection, which is only available in an automation script. In an ad-hoc data source, it should use "args.DMS.GetConnection()" instead.
You can achieve this using a small helper class that acts as a bridge between the data source connection and the SRM API. An example of such class is available here: https://gist.github.com/TomW-Skyline/82372eca4dc2e58b78f292f4822515d8
Usage example:
public OnInitOutputArgs OnInit(OnInitInputArgs args)
{
_srmManagers = new GqiSrmManagers(args.DMS.GetConnection(), args.Logger);
...
}
The properties of _srmManagers are the same as SrmManagers.Default.
Let me know if you need any further assistance.
Thanks i'll have a look and see if how i need to adapt this to work with our internal nuget 🙂