Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Any reason to prefer CefSharp over CefGlue (or vice-versa)?

In the realm of providing a decent implementation of the Chromium Embedded Framework (CEF) for .Net, the two leading options appear to be CefSharp and CefGlue. They differ in approach (CefGlue uses P/Invoke to call into the CEF unmanaged code, CefSharp uses a mixed-mode C++/CLI wrapper around the CEF libraries).

Is there some reason that a mixed-mode assembly is better than P/Invoke calls? All other things being equal, it seems like CefGlue (the P/Invoke lib) provides a "thinner" wrapper around the CEF project, which means it would probably be faster to respond to updates in the upstream library.

Is there anyone out there with experience with both libraries who can share what the differentiating factors would be?

like image 627
Drew Shafer Avatar asked Sep 01 '12 04:09

Drew Shafer


People also ask

What is CefGlue?

ChromiumEmbedded. CefGlue is a . NET binding for The Chromium Embedded Framework (CEF) by Marshall A. Greenblatt.

What is CefSharp chromium?

CefSharp is an open source . NET wrapper around the fantastic Chromium Embedded Framework. And we provide full source code in C# and C++/CLI. You can use the code to hack, improve, fork or simply debug your applications better.


2 Answers

In some sense they are about the same and whichever you'd pick you should be able to get away with in 2014. We had this question some time ago and here what we have comeup with:

CefSharp

Pluses:

  1. The WinForms is very old and mature project. If you are to use WinForms it is probably the way to go;
  2. It has a NuGet bundle, so it is easy to use and update;
  3. Supports newer version of WPF (.NET 4+);

Minuses:

  1. As @Uwe Keim had mentioned they just recently finally started to support WPF, so it is not as mature as Xillium.CefGlue;
  2. Community isn't that receptive to your needs;
  3. No Mono support.

CefGlue

Pluses:

  1. It is .NET 2.0 friendly. Your code will be able to run on it. (This was critical for us)
  2. A very responsive community which would help you to get what you need done/fixed;
  3. More mature support for WPF;
  4. Mono support.

Minuses:

  1. No NuGet package as far as I know, you'd need to add libraries and update them yourself
like image 71
Artem Avatar answered Oct 17 '22 13:10

Artem


It is 2018. The project fortunes have changed quite a bit. CefSharp is alive and well with almost daily updates in the GitHub depository. Issues are getting resolved, currently only 57 open issues and 1787 closed. CefGlue does not seem to do well. The mailing lists are moribund, there have not been recent updates. There are two forks at GitHub that resolved issues beyond the last released CefGlue version.

The fundamentals have otherwise not changed. CefSharp takes a dependency on C++/CLI code, originally an easy way to get the .NET-to-C++ interop going. But that can only work on a Windows machine and in a project that targets the full desktop version of the .NET Framework.

But not Mono, not .NET Core (relevant to Xamarin and UWP apps), or any library or project that is meant to be portable to another OS. C++/CLI is not an option in such a scenario and pinvoke must be the fallback. So CefGlue.

like image 36
2 revs, 2 users 77% Avatar answered Oct 17 '22 11:10

2 revs, 2 users 77%