Wednesday, 19 September 2018

CefSharp for WPF


below link should show you how to install it

https://www.codeproject.com/Articles/881315/Display-HTML-in-WPF-and-CefSharp-Tutorial-Part

don't use the command line :https://www.nuget.org/packages/CefSharp.Wpf/

that will only install cefsharp , didn't install dependencies for me


another thing to keep in mind is,  i have check different versions of cefsharp all of them are built on .netframework 4.5.2

if you are using 4.5, then you need to upgrade it.




What's New:
  See https://github.com/cefsharp/CefSharp/wiki/ChangeLog
  IMPORTANT NOTE - Visual C++ 2015 is now required
  IMPORTANT NOTE - .NET Framework 4.5.2 is now required. 
  IMPORTANT NOTE - Chromium has removed support for Windows XP/2003 and Windows Vista/Server 2008 (non R2).
 
  The Microsoft .NET Framework 4.5.2 Developer Pack for Visual Studio 2012 and Visual Studio 2013 is available here:
  https://www.microsoft.com/en-gb/download/details.aspx?id=42637

Basic Troubleshooting:
  - Minimum of .Net 4.5.2
  - Make sure `VC++ 2015 Redist` is installed (either `x86` or `x64` depending on your application)
  - Please ensure your binaries directory contains these required dependencies:
    * libcef.dll (CEF code)
    * icudtl.dat (Unicode Support data)
    * CefSharp.Core.dll, CefSharp.dll,
      CefSharp.BrowserSubprocess.exe, CefSharp.BrowserSubProcess.Core.dll
        - These are required CefSharp binaries that are the common core logic binaries of CefSharp.
    * One of the following UI presentation approaches:
        * CefSharp.WinForms.dll
        * CefSharp.Wpf.dll
        * CefSharp.OffScreen.dll
  - Additional optional CEF files are described at: https://github.com/cefsharp/cef-binary/blob/master/README.txt#L82
    NOTE: CefSharp does not currently support CEF sandboxing.
  - By default `CEF` has it's own log file, `Debug.log` which is located in your executing folder. e.g. `bin`




https://github.com/cefsharp/CefSharp/wiki/Frequently-asked-questions#Runtime_dependencies

4. Why do I get an error about "Could not load file or assembly 'CefSharp.Core.dll' or one of its dependencies. The specified module could not be found." when trying to run my CefSharp-based application? It compiles successfully, but does not run? It runs on my developer machine, though throws an exception when I copy it to another computer?

This is a common error, typically one of the following
  1. VC++ 2013/2015 Redistributable Package is required in order to run CefSharp on non developer machines. See FAQ #6 below for more information. You can include the required dlls as part of your application.
  2. Not all dependencies are present in the executing folder. CefSharp includes unmanaged dll's and resources, these are copied to the executing folder via two .props file which are included in your project when you install the Nuget packages. See list of required files below, make sure the required files are present.
  3. You packaged your application for distribution via an installer and it doesn't run on the target machine. Installers don't include the unmanaged resources by default, you'll need to add them manually. For ClickOnce, see #1314 for some pointers and solutions other users have come up with.
  4. "Generate serialization assembly" is set to "On" or "Auto" in Properties->Build tab. Setting this to "Off" seems to resolve the issue.
A list of required files can be found here: Output files description (Redistribution)
NOTE: This also applies if you get a FileNotFoundException when initializing the WPF contr

No comments:

Post a comment