Hi everyone, hope you all are well!
I need help with a problem when using the FileSelector, where I keep getting the following error message:
Script Failure (LogoManagementIAS): EXIT:
"Run|Something went wrong:
System.MissingMethodException: Method not found:
'Void Skyline.DataMiner.Utils.InteractiveAutomationScript.InteractiveController..ctor(
Skyline.DataMiner.Automation.IEngine,
Microsoft.Extensions.Logging.ILogger
)'.
at LogoManagementIAS.Script.RunSafe(IEngine engine)
at LogoManagementIAS.Script.Run(IEngine engine)"
I have tried downgrading and upgrading the version of Skyline.DataMiner.Utils.InteractiveAutomationScript, but nothing worked so far.
The DIS in Visual Studio and the Validate button in Cube show no errors.
Both client and server versions were upgraded recently, prior to 10.6.x.
The implementation in the code is as follows:
using System;
using System.CodeDom;
using System.Collections.Generic;
using System.Globalization;
using System.Text;
using Skyline.DataMiner.Automation;
using Skyline.DataMiner.Utils.InteractiveAutomationScript;public class Script
{
private InteractiveController controller;try
{
RunSafe(engine);
}private void RunSafe(IEngine engine)
{
controller = new InteractiveController(engine);
var fileSelector = new FileSelector
{
IsRequired = true,
AllowMultipleFiles = false,
PlaceHolder = "Select the logo image file (.png, .jpg, .jpeg, .svg)",
Tooltip = "Send the logo image file to Dataminer.",
ValidationText = "A valid image file is required (.png, .jpg, .jpeg, .svg).",
AllowedFileNameExtensions = new[] { ".png", ".jpg", ".jpeg", ".svg" },
};
dialog.OkButton.Pressed += (sender, args) =>
{
if (fileSelector.UploadedFilePaths == null || fileSelector.UploadedFilePaths.Length == 0)
{
fileSelector.ValidationState = UIValidationState.Invalid;
return;
}string uploadedFilePath = fileSelector.UploadedFilePaths[0];
string targetFolder = ...;
fileSelector.CopyUploadedFiles(targetFolder);
}
}
}
Below is the list of DLLs imported into my DMA by the DIS Publish button (exactly as generated by DIS):
System.Numerics.dll
System.ComponentModel.DataAnnotations.dll
C:\Skyline DataMiner\ProtocolScripts\DllImport\system.buffers\4.5.1\lib\net461\System.Buffers.dll
C:\Skyline DataMiner\ProtocolScripts\DllImport\system.numerics.vectors\4.5.0\lib\net46\System.Numerics.Vectors.dll
C:\Skyline DataMiner\ProtocolScripts\DllImport\system.runtime.compilerservices.unsafe\6.0.0\lib\net461\System.Runtime.CompilerServices.Unsafe.dll
C:\Skyline DataMiner\ProtocolScripts\DllImport\system.memory\4.5.5\lib\net461\System.Memory.dll
C:\Skyline DataMiner\ProtocolScripts\DllImport\microsoft.extensions.primitives\8.0.0\lib\net462\Microsoft.Extensions.Primitives.dll
C:\Skyline DataMiner\ProtocolScripts\DllImport\system.diagnostics.diagnosticsource\8.0.0\lib\net462\System.Diagnostics.DiagnosticSource.dll
C:\Skyline DataMiner\ProtocolScripts\DllImport\system.threading.tasks.extensions\4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll
C:\Skyline DataMiner\ProtocolScripts\DllImport\microsoft.bcl.asyncinterfaces\8.0.0\lib\net462\Microsoft.Bcl.AsyncInterfaces.dll
C:\Skyline DataMiner\ProtocolScripts\DllImport\microsoft.extensions.dependencyinjection.abstractions\8.0.0\lib\net462\Microsoft.Extensions.DependencyInjection.Abstractions.dll
C:\Skyline DataMiner\ProtocolScripts\DllImport\microsoft.extensions.dependencyinjection\8.0.0\lib\net462\Microsoft.Extensions.DependencyInjection.dll
C:\Skyline DataMiner\ProtocolScripts\DllImport\microsoft.extensions.logging.abstractions\8.0.0\lib\net462\Microsoft.Extensions.Logging.Abstractions.dll
C:\Skyline DataMiner\ProtocolScripts\DllImport\system.valuetuple\4.5.0\lib\net47\System.ValueTuple.dll
C:\Skyline DataMiner\ProtocolScripts\DllImport\microsoft.extensions.options\8.0.0\lib\net462\Microsoft.Extensions.Options.dll
C:\Skyline DataMiner\ProtocolScripts\DllImport\microsoft.extensions.logging\8.0.0\lib\net462\Microsoft.Extensions.Logging.dll
C:\Skyline DataMiner\ProtocolScripts\DllImport\skyline.dataminer.utils.interactiveautomationscripttoolkit\10.5.8.1\lib\net48\Skyline.DataMiner.Utils.InteractiveAutomationScriptToolkit.dll
Any guidance on how to properly handle the new ILogger dependency in IAS, or which versions are compatible with DataMiner versions prior to 10.6.x, would be greatly appreciated.
Thanks in advance!
Hi João,
Is it possible to add below comment somewhere in your script? This is required to make DataMiner recognize it as an interactive script.
// Engine.ShowUI();
Hi Jens, thank you for your response! Unfortunately it didn't work.
I have seen this comment in the doc and the nuget package description but it do not worked for me.
My code is as follow:
public void Run(IEngine engine)
{
try
{
// DO NOT REMOVE THE COMMENTED OUT CODE BELOW OR THE SCRIPT WONT RUN!
// Interactive scripts need to be launched differently.
// This is determined by a simple string search looking for "engine.ShowUI" in the source code.
// However, due to the NuGet package, this string can no longer be detected.
// This comment is here as a temporary workaround until it has been fixed.
// engine.ShowUI();
RunSafe(engine);
(the rest of the code is the same as showed in the question)
But when i tried to run, it throw the same error.
Script Failure (SetLogToService): EXIT: "Run|Something went wrong: System.MissingMethodException: Method not found: 'Void Skyline.DataMiner.Utils.InteractiveAutomationScript.InteractiveController..ctor(Skyline.DataMiner.Automation.IEngine, Microsoft.Extensions.Logging.ILogger)'.
at SetLogToService.Script.RunSafe(IEngine engine)
at SetLogToService.Script.Run(IEngine engine)" (see comment for more details)
Update: I tried using the IAS without the FileSelector (just dialog and dropdown), and I'm still getting the same error.