Hello everyone, can someone help with the following error?
(Code: 0x80004003) Skyline.DataMiner.Net.Exceptions.DataMinerException: Array cannot be null.
Parameter name: bytes ---> System.ArgumentNullException: Array cannot be null.
The code i'm using is this:
public void Run(Engine engine)
{
try
{
var dms = engine.GetDms();
var newElement = dms.GetElement("SmartWifi Alarm Collector");
IDma dma = dms.GetAgent(agentid);
newElement.Duplicate("SmartWifi Alarm Collector - BKP2", dma);
}
catch
{
throw;
}
}
With this code i can access the agent, get all the info, but when i try to duplicate a element from another agent into it, i get the error listed above.
Hello Davor, i think everything is right, the Duplicate method requires a (string name, IDma dma), i’m passing that IDma and if i try to access the data inside it i can and i can see the data, but if i try to use that IDma to set as a value needed by Duplicate method, i get the error above. Maybe it’s a bug?
Yeah, maybe its a bug, but i cant confirm it.
Duplication Method Parameters: Check the Duplicate method’s implementation. Ensure that the parameters you are passing (“SmartWifi Alarm Collector – BKP2″ and dma) are valid and that there’s no underlying assumption that might lead to a null reference.
catch (Exception ex)
{
Console.WriteLine($”Error: {ex.Message}”);
throw; // Optionally rethrow or handle it differently
}
try this to your code where ever is stoped i think