DEV Community

Bruce Axtens
Bruce Axtens

Posted on

1

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)

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free →

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay