question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"InvalidOperationException - object is currently in use elsewhere" on Windows 1809

See original GitHub issue

Since the Windows 10 1809 release, we observed issues on some customers with the ribbon.

It seems that something is wrong with the Graphics object and its use in Krypton.

In our case, the issue occurs when we use a OpenFileDialog. It raise an exception on the Form app:

   à System.Drawing.Graphics.Restore(GraphicsState gstate)
   à System.Windows.Forms.Control.WmPaint(Message& m)
   à System.Windows.Forms.Control.WndProc(Message& m)
   à ComponentFactory.Krypton.Toolkit.VisualControlBase.WndProc(Message& m)
   à ComponentFactory.Krypton.Ribbon.KryptonRibbon.WndProc(Message& m)
   à System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   à System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   à System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

For now, I am trying to reproduce the problem on my dev machine with debug builds.

If I am able to reproduce the problem locally I will update the issue.

Perhaps the root issue is the same as #46, and this windows update made the problem more frequent, I don’t know yet.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:20 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
tboloncommented, Jun 27, 2019

FYI, this problem does not seems to occur anymore on v1903. You can consider this problem fixed in the fwk itself.

1reaction
tboloncommented, Jan 16, 2019

Thank you @Wagnerp. I will certainly use the 5.470 repo for issues (related to the ribbon & form integration bug) , as it seems to be the most active.

Read more comments on GitHub >

github_iconTop Results From Across the Web

c# - InvalidOperationException - object is currently in use ...
Now SOMETIMES I'm getting "InvalidOperationException - object is currently in use elsewhere". Its very arbitrary. I somtimes get this in ...
Read more >
Object already in use elsewhere c# even if using the lock ...
Hi. I try to draw onto bitmap inside a picturebox from multiple tasks. This is a simplified version of my main code.
Read more >
InvalidOperationException - Object is currently in use ...
Text assignment of course happens on the UI thread! Here is the exception call strack: Error Message: Object is currently in use elsewhere....
Read more >
System.invalidoperationexception: 'object is currently in ...
I have some code that shows network traffic on a proxy class, when I run the code I get random errors where the...
Read more >
Getting an error [Object is in use elsewhere] when ...
InvalidOperationException HResult=0x80131509 Message=Object is currently in use elsewhere. Source=System.Drawing StackTrace: at System.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found