OpcCom. Factory fa=new OpcCom. Factory (false);
Opc. Da. The Opc Server m_server_two=new. Da. The Server (fa, url);
M_server_two. The Connect ();
Code as above, a total of two projects, the project 1 is winfrom program, click on the normal connection using the
Project 2 is a Windows service application has not been registered error
: Opc. ConnectFailedException: E_NETWORK_ERROR
Could not connect to server. - & gt; System. The Runtime. InteropServices. ExternalException: CoCreateInstanceEx: no register class
In OpcCom. Interop. CreateInstance (Guid clsids, String hostName, NetworkCredential credential)
In OpcCom. Factory. Connect (URL URL, ConnectData ConnectData)
- at the end of the inner exception stack trace -- -- --
. The Opc Server. The Connect (URL URL, ConnectData ConnectData)
... The Opc Da Server Connect (URL URL, ConnectData ConnectData)
. The Opc Server. The Connect ()
Two projects of configuration, are x86
CodePudding user response:
The same environment?The same machine 2 application?
CodePudding user response: