Skip to content

BadSecureChannelClosed、BadSecureChannelIdInvalid ; 如何避免?或者ReadNodeAsync时的正确写法是什么? #68

@lison999

Description

@lison999

[2025-12-02 03:58:29.971][2,MainUi] [ERR][] APP未捕获异常: System.AggregateException: A Task's exception(s) were not observed either by Waiting on the Task or accessing its Exception property. As a result, the unobserved exception was rethrown by the finalizer thread. (BadSecureChannelIdInvalid)
---> Opc.Ua.ServiceResultException: BadSecureChannelIdInvalid
at Opc.Ua.ClientBase.ValidateResponse(ResponseHeader header)
at Opc.Ua.SessionClient.EndRead(IAsyncResult result, DataValueCollection& results, DiagnosticInfoCollection& diagnosticInfos)
at OpcUaHelper.OpcUaClient.<>c__DisplayClass45_0`1.b__0(IAsyncResult ar)
at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
--- End of inner exception stack trace ---

连续运行10天左右出现上述问题!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions