C# OPC Client遇到了个问题,怎么也解决不了

net 开发OPC Client,使用自动化接口,OPCDAAuto.dll 2.02.5.20,在创建组的时候

OpcGroups = OpcServer.OPCGroups; << 这行运行时抛异常:
System.InvalidCastException: 无法将类型为“OPCAutomation.OPCServerClass”的对象强制转换为类型“OPCAutomation.IOPCGroups”。
在 OPCAutomation.OPCServerClass.get_OPCGroups();

OPCDAAuto.dll 已注册,版本也一致。

求解决方案!!!

前面一个OpcGroups的类型是什么,是不是定义错了。

左值与右值的类型不一致,左值类型是group类型,你看看右值类型是不是错了

类型没有错,编译也是可以通过的
OPCAutomation.OPCGroups myGroups;
myGroups = OPCAutomation.OpcServer.OPCGroups;