Page 1 of 1

CefSettings Constructor failed

PostPosted: Fri Apr 09, 2021 5:15 am
by Jeff
I tried to move my code to another pc, and found it did not work. And It quit when try run the constructor code of CefSettings with follow errors.

var settings = new CefSettings();

Error Message:
021/04/09 17:34:34 at CefSharp.CefSettingsBase..ctor()
at CefSharp.Wpf.CefSettings..ctor() C:\projects\cefsharp\CefSharp.Wpf\CefSettings.cs: line 16


Run it in both Win7 and Win 10. Any one know why and how to fix?

Cef v88.2.90

thanks,

Re: CefSettings Constructor failed

PostPosted: Fri Apr 09, 2021 2:16 pm
by amaitland
Make sure you have visual c++ installed. This is required on every computer you plan to run CefSharp on.

https://github.com/cefsharp/CefSharp/bl ... me.txt#L26

Re: CefSettings Constructor failed

PostPosted: Sat Apr 10, 2021 4:10 am
by Jeff
HI, Amaitlad, Thanks for the reply. Yes, right. we have .net framework 4.6.1, and VC++ 2015 redistributable (x64).

And we can it well in my local machine, but failed when move to another one. We checked against the readme file, seem no help.

Any idea, thanks?

Re: CefSettings Constructor failed

PostPosted: Sat Apr 10, 2021 2:57 pm
by amaitland
Is your application targeting x64? If your app targets x86 or AnyCpu with Prefer32Bit then you'll need to install the x86 version of visual c++.

Not having the correct version/bitness of vc++ installed on a non developer PC is the number one cause of "it works on my pc and not on others", the second most common is not all files are included, click once installer for example doesn't include all the required resources without extra configuration.

If that doesn't work then please provide a stack trace for the exception.

Re: CefSettings Constructor failed

PostPosted: Sat Apr 10, 2021 9:18 pm
by Jeff
Cool. It works now after x86 VC++ package installed. Great. Thanks a lot. You are my superman. Amaitland, appreciate. :-)