0

I run my cefsharp application using task scheduler on windows server. I have succeed exit with Application.exit(). But the status in task scheduler is still running not stopped.

I think, it was happenned because I didn't use Cef.shutdown(). But in this case I am getting error when use this syntax like this :

**`

Shutdown must be called on the same thread that Initialize was called - typically your UI thread. CefSharp was initialized on ManagedThreadId: 10

`**

Please help to solve this issue. Thanks

Balakrishna D
  • 464
  • 9
  • 21

1 Answers1

0

I experienced this issue. As the error suggests it does relate to threading, in my example the browser existed on another form which was created on a second thread. A quick solution was to inject the ChromiumBrowser into the constructor of the second form, that way it was disposed correctly from the main thread.

Hope this helps someone!

Cookie
  • 136
  • 4
  • It does **NOT** actually provide an answer to the question, and can be perceived as noise by its future visitors. Once you earn enough [reputation](https://stackoverflow.com/help/whats-reputation), you will gain privileges to **comment**. – Hearen Jul 25 '18 at 10:18