C# OPC Client fails to get server list

2

After I compiled my C# in my new Windows 8 64-Bit machine, I started to get the following error while getting list of available servers in my OPC client application.

"OpcNetApi.Com Unable to cast COM object of type 'System.__ComObject' to interface type 'OpcRcw.Comn.IOPCServerList2'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{9DD0B56C-AD9E-43EE-8305-487F3188BF7A}' failed due to the following error: Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))."

What could be the reason?

c#
opc
asked on Stack Overflow Aug 14, 2013 by Demir

4 Answers

9

Quoted from the OPC.NET readme :

The .NET COM interop assemblies are built against the 32-bit versions of the proxy/stubs. This means that any .NET application running on x64 systems must be compiled and run as a 32-bit application

answered on Stack Overflow Aug 14, 2013 by Camille G.
7

Hi: To solve this problem install OPC .NET API OPC .NET API 2.00 Redistributables 105.1 and then install OPC Core Components Redistributable (x64) 105.1. With this you can connect to OPC Server runing in 32 bits fom client running on 64 bit.

answered on Stack Overflow May 20, 2014 by user2480745 • edited Oct 18, 2016 by Olivier De Meulder
2

And don't foget, that Redistributables (OPC .NET API OPC .NET API 2.00 Redistributables, OPC Core Components Redistributables) and libraries (OpcNetApi.dll, OpcNetApi.Com.dll, OpcNetApi.Xml.dll...) referenced in your project must be the same versions.

answered on Stack Overflow Apr 24, 2016 by undejavue
-1

i think the only problem is you are trying to connect to remote machine with different user and password you must create your current user in remote machine same as local machine username and password then you must configure on remote machine "component services"->Console root->Component Services->Computers->Dcom config->OpcEnum setting and give access to this user in Properties -> Security my problem solved by this way good luck

answered on Stack Overflow Jan 31, 2019 by kaydream

User contributions licensed under CC BY-SA 3.0