VS2010调用OPCAutomation,报 System.AccessViolationException

yuanchong8130 2017-04-14 08:53:37
各位好!
项目中遇到使用windowservice调用OPCAutomation时,调用OpcGroup.SyncRead方法错误,直接将windowservice关闭了。
访问受保护的内存?此时,重新启动服务,没办法启动,IOPCAutoServer.Connect联接失败。
持续6分钟后,可以启动OPC。

初始保存就是SyncRead方法报出来: System.AccessViolationException。
OPCServcer在本地,程序也在本地。

这个情况,该如何解决?

Framework 版本: v4.0.30319

说明: 由于未经处理的异常,进程终止。

异常信息: System.AccessViolationException

堆栈:

在 OPCAutomation.OPCItems.GetOPCItem(Int32)

在 ISS.Project.BLL.OPCClient.Read(System.String)

在 ISS.Project.BLL.Heart.ReadHeartMonitor(Int32)

在 AMESAVIServerNameSpace.AMESAVIServer.ReadHeartBeatHandle(System.Object, System.Timers.ElapsedEventArgs)

在 System.Timers.Timer.MyTimerCallback(System.Object)

在 System.Threading._TimerCallback.TimerCallback_Context(System.Object)

在 System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)

在 System.Threading._TimerCallback.PerformTimerCallback(System.Object)

报文上边那个错之后,就报连接不上
AVIService System.Exception: System.Runtime.InteropServices.COMException (0x8000401A): 因为配置标识不正确,系统无法开始服务器进程。请检查用户名和密码。
...全文
1203 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

110,534

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧