Hello people!
I’m trying to embed a Chromium browser within a plugin. It works fine with the default windows browser but I just can’t get it to work with CefSharp. The issue that I’m having is that the component where I use the reference can’t find the CefSharp.Core.dll or one of it’s dependencies (error message in picture 1). Then Rhino shuts down with an error message within about 10 seconds after the component is executed if that is any clue to what the problem might be.
In VS the project builds without any problem and I’ve referenced CefSharp.dll, CefSharp.Core and CefSharp.Wpf in as references. I’m using x64 as build platform and all the CefSharp files are the x64 version. I didn’t add any post build event so I’m manually copying over the gh assembly and reference files to the /grasshopper/libraries/ folder after each build (the CefSharp references I’ve added in picture 2.)
I’m using .NET 4.5.2 and CefSharp 81.3.100 installed as nugget.
Thank you for your time to look into this!
Erik
1.The error message
- The reference files in my /libraries/ folder
Hi Erik,
Try adding the CefSharpCore to the special components folder were your plugin .gha file lives.
Hello Nicholas ,
Thank you for your reply! So, the second picture is my grasshopper/libraries/ folder (special components) where I’ve copied over the .dlls. I have the file called ‘CefSharp.Core.dll’ in that folder, but maybe there is a underlying reference I’m missing? Do you know what that could be? Also, I’ve unblocked all the files already.
Erik
Hey Erik,
Looks like Rhino and GH aren’t able to load your Cef assemblies for some reason.
I would run this with a VS debugger attached to the Rhino process by either copying the entire output folder to Grasshopper/Libraries (using a post build script) or using the GrasshopperDeveloper command to add your bin folder path. That might give you more specifics about the error.
Hard to tell what’s going on without seeing any source code. Can you share example code needed to reproduce the behavior?
1 Like
I’m assuming @erikforsberg95 is compiling a gha that will trigger a Cef browser to pop up, but it would be great with some more details about the context.
Ok I answered without going in the detail.
2 Likes
Hello Emil,
thanks for the answer. I’ve done some debugging now and I took your advice and added the /bin/ in the DeveloperSettings. When debugging I get the same error message; that it cannot load the CefSharp.Core.dll. This file is also located in the /bin/ folder and unblocked.
I also tried to reproduce the error inside the native gh c# component as Laurent suggested but I still get the error that the reference failed to load. The intellisense works fine so it is definitely loading CefSharp.dll and CefSharp.Wpf.dll.
The only code I can can share to reproduce the behaviour is the .dll files I’m using and this one line because it’s the only time I use the reference. Hope this helps to understand the problem better. Thanks for the help!
CefSharp.Wpf.ChromiumWebBrowser cwb = new CefSharp.Wpf.ChromiumWebBrowser("google.se");
cefsharp.zip (838.9 KB)