Hi,
I've run into an issue again.
I'm trying to filter an table based on a few pids so i thought of using QueryData. However i'm getting this error
Script Failure (RSTielineCrud): System.MissingMethodException: Method not found: 'Skyline.DataMiner.Core.DataMinerSystem.Common.IDms Skyline.DataMiner.Core.DataMinerSystem.Automation.IEngineExtensions.GetDms(Skyline.DataMiner.Automation.IEngine)'.
at CManagedAutomation.RunEntryPointWrapped(CManagedAutomation* , Int32 iCookie, IUnknown* pIAutomation, tagVARIANT* varParameters, tagVARIANT* varEntryPoint, tagVARIANT* pvarReturn, String scriptName, tagVARIANT* pvarEntryPointResult)
at CManagedAutomation.Run(CManagedAutomation* , Int32 iCookie, Char* bstrScriptName, IUnknown* pIAutomation, tagVARIANT* varParameters, tagVARIANT* varEntryPoint, tagVARIANT* pvarReturn, tagVARIANT* pvarEntryPointResult) (CSharp; 0x80004005h): (see comment for more details)
So i stripped the script to bare minimum but still i got the error on this script:
namespace RSTielineCrud_100
{
using System;
using System.Collections.Generic;
using System.Linq;
using Skyline.DataMiner.Automation;
using Skyline.DataMiner.Core.DataMinerSystem.Automation;
using Skyline.DataMiner.Core.DataMinerSystem.Common;
using Skyline.DataMiner.Net.Apps.DataMinerObjectModel;
/// <summary>
/// Represents a DataMiner Automation script.
/// </summary>
public class Script
{
/// <summary>
/// The script entry point.
/// </summary>
/// <param name="engine">Link with SLAutomation process.</param>
public void Run(IEngine engine)
{
engine.GenerateInformation("This script should be run from DOM CRUD");
}
{
try
{
IDms dms = engine.GetDms();
IDmsElement ionVmatrix = dms.GetElement(new DmsElementId(128710, 9));
List<ColumnFilter> sourcefilter = new List<ColumnFilter>
{
new ColumnFilter { Pid = 1602, Value = "ea2f6edd-7637-4b7a-b2a2-05d322f83db9", ComparisonOperator = ComparisonOperator.Equal },
new ColumnFilter { Pid = 1607, Value = "4514", ComparisonOperator = ComparisonOperator.Equal },
};
IEnumerable<object[]> sourceTable = ionVmatrix.GetTable(1600).QueryData(sourcefilter);
engine.GenerateInformation($"RS TEST Found: {sourceTable.Count()}");
}
catch(Exception e)
{
engine.GenerateInformation($"EXEPTION: {e.Message}");
}
}
}
}
As you can see it doesn't throw an exeption it just stops directly. I've loaded the following nugets:
<PackageReference Include="Skyline.DataMiner.Core.DataMinerSystem.Automation" Version="1.1.2.1" />
<PackageReference Include="Skyline.DataMiner.Core.DataMinerSystem.Common" Version="1.1.2.1" />
<PackageReference Include="Skyline.DataMiner.Dev.Automation" Version="10.4.5" />
I don;t get compile errors or validation errors.
Target Version is 10.4.5
For anyone who want to to test this: https://github.com/Gerwin-RBM/IDMS_Issue
You might also put in in the run block i'm getting the same error.
Hi Gerwin, can you check if all dlls are correctly referenced under the script code in dataminer? I am also posting a screenshot of section mentioned, so you can have a better representation of what I said
I see that in package reference, you have both packages listed with version "1.1.2.1", and the version 1.1.1.5 of "Skyline.DataMiner.Core.DataMinerSystem.Automation" is listed in the dll references. Can you try to align the versions, and also confirm that mentioned dlls are found in their paths?
Ah yes, i;ve updated skyline.dataminer.core.dataminersystem.automation to the latest version to see if that might fix the issue. However when the DLL is not found in the path i do get an validation error or the script. I didn't get those so there for i assumed the files most be there.
changed it back but still the same issue
Hi Gerwin, you could even completely remove the reference to Skyline.DataMiner.Core.DataMinerSystem.Common as this is automatically included by having the reference to Skyline.DataMiner.Core.DataMinerSystem.Automation.
Hi Gerwin, did you get this working? Otherwise, could you republish your script?
According to the previous comments it looks like the version of the Automation NuGet doesn't match the one of Common NuGet. That mismatch is known to give these kinds of issues.
Yes they are there:
C:Skyline DataMinerProtocolScriptsDllImportskyline.dataminer.core.dataminersystem.common1.1.2.1libnet462Skyline.DataMiner.Core.DataMinerSystem.Common.dll
C:Skyline DataMinerProtocolScriptsDllImportskyline.dataminer.core.dataminersystem.automation1.1.1.5libnet462Skyline.DataMiner.Core.DataMinerSystem.Automation.dll