titanium-as / TitaniumAS.Opc.Client

Open source .NET client library for OPC DA
MIT License
193 stars 94 forks source link

Bootstrap Throwing Error about CoInitializeSecurity #17

Closed sarthak-k closed 6 years ago

sarthak-k commented 6 years ago

Hi,

I'm currently facing some issue with the initialization of the DA Client. The external exception throws: CoInitializeSecurity: Security must be initialized before any interfaces are marshalled or unmarshalled. It cannot be changed once initialized.

Can anybody point me how to start console application with this library?

alexey-titov commented 6 years ago

From readme.md: https://github.com/titanium-as/TitaniumAS.Opc.Client:

Bootstrapping the library

Call Bootstrap.Initialize() in the start of your application. An application process should be started under MTA apartment state due to CoInitializeSecurity call during the library initialization.