Could not load configuration file

I am trying to implement OPC UA client in Unity. But I am getting an ServiceResultException: Could not load configuration file expection in line application.LoadApplicationConfiguration("ConsoleReferenceClient.Config.xml", false).Wait();
which means the “Config.xml” file couldn’t be loaded in Unity. But the same program works perfectly in console application. How can I load the configuration file in unity?

void Start()
{
            // Define the UA Client application
            ApplicationInstance application = new ApplicationInstance();
                application.ApplicationName = "Quickstart Console Reference Client";
                application.ApplicationType = ApplicationType.Client;
           
   
            // load the application configuration.
            application.LoadApplicationConfiguration("Assets/ConsoleReferenceClient.Config.xml", false).Wait();
                // check the application certificate.
                application.CheckApplicationInstanceCertificate(false, 0).Wait();
   
                // create the UA Client object and connect to configured server.
                Quickstarts.ConsoleReferenceClient.UAClient uaClient = new Quickstarts.ConsoleReferenceClient.UAClient(application.ApplicationConfiguration);
   
                if (uaClient.Connect())
                {
                    uaClient.ReadNodes();
                    //uaClient.WriteNodes();
                    uaClient.Browse();
                    //uaClient.CallMethod();
                    uaClient.SubscribeToDataChanges();
                    System.Threading.Thread.Sleep(20000);
   
                    uaClient.Disconnect();
                }
                else
                {
                    Debug.Log("Could not connect to server!");
                }
                Debug.Log("\nProgram ended.");
                Debug.Log("Press any key to finish...");
                Console.ReadKey();
}

Exception:

ServiceResultException: Could not load configuration file.
    Opc.Ua.Configuration.ApplicationInstance+<LoadApplicationConfiguration>d__33.MoveNext () (at <1c5dac388c934c65a66a1f12b206c16d>:0)
    Rethrow as AggregateException: One or more errors occurred.
    System.Threading.Tasks.Task.ThrowIfExceptional (System.Boolean includeTaskCanceledExceptions) (at <fb001e01371b4adca20013e0ac763896>:0)
    System.Threading.Tasks.Task.Wait (System.Int32 millisecondsTimeout, System.Threading.CancellationToken cancellationToken) (at <fb001e01371b4adca20013e0ac763896>:0)
    System.Threading.Tasks.Task.Wait () (at <fb001e01371b4adca20013e0ac763896>:0)
    TestClient.Start () (at Assets/Scripts/TestClient.cs:25)

You may need to insert Application.dataPath into the file path if you really want to use the Assets folder. Your post said it isn’t finding Config.xml, I’m not sure if you’re being brief or not, but the filename your code is actually trying to open is ConsoleReferenceClient.Config.xml. Make sure that’s the actual filename. Also, you will not be able to open an xml file this way located in the Assets folder in a build. If your error is with your build, it is probably because the Assets folder does not actually exist in a build. Try using StreamingAssets instead.

I don’t know anything specifically about OPC UA clients in Unity, so I’m just commenting on the potential file path issues.

Thank you for your suggestion. I have tried that. The problem is not with the datapath. I have tried withour loading the file.
I think the problem is for broken assembly. Some of my assembly couldn’t be loaded. I have created a ** thread ** about that. Could you please help me regarding that?