CefSharp WPF Error

Viewed 2843

Have used CefSharp to use the chromium web browser in a WPF project. The build works as expected, but when published, the error received is:

The invocation for the constructor on type 'CefSharp.Wpf.ChromiumWebBrowser' that matches the specific binding constraints threw an exception.' Line number '24' and line position '15'. IsTerminating:True

Have followed the advise here:

https://github.com/cefsharp/CefSharp/issues/2030

Which unfortunately has not yielded any results, have also followed the read me here:

https://github.com/cefsharp/cef-binary/blob/master/README.txt#L82

The files exist in the published directory, but in the event viewer, the error:

Application: APP.exe Framework Version: v4.0.30319 Description: The process was terminated due to an unhandled exception. Exception Info: System.IO.FileNotFoundException at CefSharp.Wpf.ChromiumWebBrowser.NoInliningConstructor() at CefSharp.Wpf.ChromiumWebBrowser..ctor()

Any assistance appreciated, as am not sure where else to look to resolve.

2 Answers

I had this problem after updating the NuGet package. I realized that my installer was copying dependencies from a folder named "Needed" where I had previously painstakingly collected all of the files needed to run the application (with lots of unmanaged things). So when I ran the exe from the build folder it worked fine, but when I installed it, it crashed because all of the DLLs were for the previous version. A quick fix for me was to just copy all of the contents of my build folder to the silly "Needed" folder I had previously made.

Hopefully I'll find this a year from now when it happens again.

Related