Unity3D Editor : Runtime Error on play

Hi,

I work on an application uses OPC protocol for automation. For this, I am using a dll : Interop.OPCAutomation.dll.

I load it in the Assets/Plugins directory in my Unity 3D Project.

When I call a function of this Reference in my Game Objet’s script, Unity generates a C++ RunTime Error when I play my application in the editor.

The script is very simple :

using UnityEngine;
using System.Collections;

using OPCAutomation;

public class NewBehaviourScript : MonoBehaviour 
{
	// Use this for initialization
	void Start () 
	{
		OPCServerClass Server = new OPCServerClass();
	}
	
	// Update is called once per frame
	void Update () 
	{
	
	}
}

If i create this application with mono Develop, it works :

using System;
using OPCAutomation;

namespace testAuto
{
	class MainClass

	{
		public static void Main (string[] args)

		{

			Console.WriteLine ("Test Auto");

			OPCServerClass Server = new OPCServerClass();

			Console.WriteLine ("OPC server Created");
		}
	}
}

What do you think of that problem?
What wrong with this dll?

Thank you in advance for any information.

Best regards

Hi again,

I have the crash when i use regsvr32 to register my com dll in windows.

When i unregister it and play application inside Unity I have a com exception when i start the editor:

COMException
System.Runtime.InteropServices.Marshal.ThrowExceptionForHR (Int32 errorCode)
System.__ComObject.Initialize (System.Type t)
(wrapper remoting-invoke-with-check) System.__ComObject:Initialize (System.Type)
Mono.Interop.ComInteropProxy.CreateProxy (System.Type t)
System.Runtime.Remoting.RemotingServices.CreateClientProxyForComInterop (System.Type type)
System.Runtime.Remoting.Activation.ActivationServices.CreateProxyForType (System.Type type)
NewBehaviourScript.Start () (at Assets/NewBehaviourScript.cs:12)

Any idea?

Thank you in advance