C# OPC 客户端获取服务器列表失败

标签 c# opc

在我的新 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/

相关文章:

c# - 为什么不能在 C# 中没有大括号的 switch 部分中使用 using 变量?

c# - 静态类中静态字段的初始化顺序

c++ - 从头开始实现经典 OPC DA 服务器

java - 将 boolean 值写入 OPC UA 服务器 - "not of the same type"错误

matlab - OPC 服务器 : Start Stop Pause getData(again use) DYMOLA MATLAB

c - UAEexpert 找不到 OPC UA 服务器证书

mercurial - 在 Mercurial 中指定编辑器

c# - EntityFramework 存储库从接口(interface)和抽象类 : how to use dependency inject on ASP. NET MVC 驱动

c# - 在 C# 中检测 CPU 的管理程序标志

c# - 如何使用 Entity Framework 选择单个列?