CEFSharp inside AddIn - "Cannot pass GCHandle through AppDomains"
I am programming AddIn for Solid Edge using AddE. With this AddIn, the EdgeBar containing the website should be displayed.
Since I don't want to use the standard Windows Forms WebBrowser control (it only uses the IE rendering engine), I'm trying to use the Chromium Embedded Framework with its .NET CEFSharp bindings ( https://github.com/cefsharp/CefSharp ).
When creating a new Windows Forms application, the CEFSharp control nesting works fine. But when I paste it into my AddIn code, I get the following error after starting Solid Edge with AddIn activated and the program crashes:
An unhandled exception of type 'System.ArgumentException' occurred in mscorlib.dll
Additional information: Can't pass GCHandle through AppDomains.
I found a similar CEFSharp issue related to the AppDomain issue ( https://github.com/cefsharp/CefSharp/issues/351 ), but I really don't see a solution for my issue.
(Notes: Target Framework is .NET Framework 4.5, a type of Class Library. I am using Visual Studio 2013, programming language is C #).
source to share
This pull request ( https://github.com/cefsharp/CefSharp/pull/1556 ) completely solves my problem. Since it hasn't made its way to the CefSharp wizard yet, I built it myself and everything works :-)
Let's assume that it will be on release soon, so you won't have to deal with this problem anymore.
source to share
Got this to work in Excel just in case anyone wants to know https://github.com/cefsharp/CefSharp/issues/1191#issuecomment-215503558
source to share