DEV Community

Bruce Axtens
Bruce Axtens

Posted on

In a non-UI application, how do I handle “The calling thread cannot access this object because a different thread owns it”

0

I've read through the discussion at The calling thread cannot access this object because a different thread owns it but it's all about UI.

I have two C# EXEs that are purely command-line, but are throwing this error as well.

Perhaps the full exception message will help:

System.InvalidOperationException
  HResult=0x80131509

Top comments (0)