I have a problem in my OPC client application using OPC NET API 2.00, so when I want to connect to ABB Freelance OPC Server, it throws an exception when calling Opc.Server.Connect(Opc.ConnectData) method.
Exception:
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: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).
May be Problem relates to IOPCServerList2 interface:
#region Assembly OpcRcw.Comn.dll, v1.10.2.0
// C:\Windows\assembly\GAC_MSIL\OpcRcw.Comn\1.10.2.0__9a40e993cbface53\OpcRcw.Comn.dll
#endregion
using System;
using System.Runtime.InteropServices;
namespace OpcRcw.Comn
{
[Guid("9DD0B56C-AD9E-43EE-8305-487F3188BF7A")]
[InterfaceType(1)]
public interface IOPCServerList2
{
void CLSIDFromProgID(string szProgId, out Guid clsid);
void EnumClassesOfCategories(int cImplemented, Guid[] rgcatidImpl, int cRequired, Guid[] rgcatidReq, out IOPCEnumGUID ppenumClsid);
void GetClassDetails(ref Guid clsid, out string ppszProgID, out string ppszUserType, out string ppszVerIndProgID);
}
}