The type 'Diagnostic' exists in both 'OpenSpan, Version=25.1.0.0, Culture=neutral, PublicKeyToken=f5db91edc02d8c5e' and 'Pega.Xray

Getting issue when validating script in pega robotics studio v-25.1.1. Below is the code:

catch (Exception ex)
{
OpenSpan.Diagnostics.Diagnostic.PublishException(ex);
return false;
}

@AshKS This is the old way to write log entries in a script. To see examples of the new methods, create a new script container. There are examples placed in each new script you create that you can copy over to your older scripts. Here they are for reference.

#region Usings

using System;
using System.Collections;
using System.Collections.Specialized;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Reflection;
using System.Web;
using System.Windows.Forms;
using System.Xml;

using ScriptLogger = Pega.Core.Script.ScriptLogger;

#endregion

public class Script
{
#region Logging examples

// ScriptLogger.LogDebug(“test”);
// ScriptLogger.LogInformation(“test”);
// ScriptLogger.LogWarning(“test”);
// ScriptLogger.LogError(“test”);
// ScriptLogger.LogException(exception);
// ScriptLogger.LogException(exception, “test”);

#endregion

}