在我的新 Windows 8 64 位机器上编译我的 C# 后,在我的 OPC 客户端应用程序中获取可用服务器列表时,我开始遇到以下错误。
"OpcNetApi.com 无法将“System.__ComObject”类型的 COM 对象转换为接口(interface)类型“OpcRcw.Comn.IOPCServerList2”。此操作失败,因为 IID 为“{9DD0B56C-AD9E-43EE-8305-487F3188BF7A}”的接口(interface)的 COM 组件上的 QueryInterface 调用因以下错误而失败:类未注册(HRESULT 异常:0x80040154 (REGDB_E_CLASSNOTREG))。 "
可能是什么原因?
最佳答案
引自 OPC.NET 自述文件:
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
关于C# OPC 客户端获取服务器列表失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18233248/