How to build CefSharp ?

2,479 views
Skip to first unread message

pattie103

unread,
Aug 15, 2012, 10:30:15 AM8/15/12
to cefs...@googlegroups.com

Hello, 

I've been following the building guide of CEFSharp ( https://github.com/chillitom/CefSharp/wiki/Building-CefSharp ) and i'm stuck on where i should place the libcef.liblibcef_dll_wrapper.lib and libcef.dll  in the CEFSharp project to be able to build.

Currently i have CEFSharp v1.19 and CEF branch 1180, both of them go with Chromium version 21.0.1180.18.

Can anyone give me some instructions on how to go on from the last point in the guide ?

Thanks.

anthony taranto

unread,
Aug 15, 2012, 2:44:13 PM8/15/12
to cefs...@googlegroups.com
The instructions on the chillitom fork wiki are out of date, here are my more recent instructions:

https://github.com/ataranto/CefSharp/wiki/Building-CefSharp

The .lib and .dll files are checked into the CefSharp repo, just replace them with the updated files genereted by your CEF build, or use the included script.

Also, note that my 1.19 release branch is based on CEF branch 1084, _not_ 1180. This may be the cause of your problems.

--Anthony

pattie103

unread,
Aug 16, 2012, 5:50:13 AM8/16/12
to cefs...@googlegroups.com
Thank for the information.

I found v1.21 of CEFSharp in the repo. is this a version that is build on 1180 branch of CEF ?



Op woensdag 15 augustus 2012 20:44:13 UTC+2 schreef anthony taranto het volgende:

anthony taranto

unread,
Aug 16, 2012, 1:38:08 PM8/16/12
to cefs...@googlegroups.com

Yes, I just haven't made a binary release from that branch yet.

--
You received this message because you are subscribed to the Google Groups "CefSharp" group.
To view this discussion on the web visit https://groups.google.com/d/msg/cefsharp/-/yjFk7ZTjeQEJ.
To post to this group, send email to cefs...@googlegroups.com.
To unsubscribe from this group, send email to cefsharp+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/cefsharp?hl=en.

pattie103

unread,
Aug 17, 2012, 2:47:23 AM8/17/12
to cefs...@googlegroups.com
Will touch scrolling work in CEFSharp if i set EnableTouch true in the CEF build ? i'm trying to get touch events in the browser, but i'm not sure if it will work if i do it this way.

Thanks.

Op donderdag 16 augustus 2012 19:38:08 UTC+2 schreef anthony taranto het volgende:

pattie103

unread,
Aug 20, 2012, 5:08:14 AM8/20/12
to cefs...@googlegroups.com
I've build the CEF files needed to build CEFSharp and used update_from_cef.sh to get the correct files from CEF.

But when i start building i succeed in building the cefsharp project, cefsharp.wpf project, cefsharp.wpf.example project after setting .net to 4 and cefsharp.example after setting .net to 4.

but when i try to start cefsharp,wpf.example in debug mode i get this error:

System.BadImageFormatException was unhandled
  Message=Could not load file or assembly 'CefSharp, Version=1.21.0.17151, Culture=neutral, PublicKeyToken=null' or one of its dependencies. Attempt to load a program with an incorrect format.
  Source=CefSharp.Wpf.Example
  FileName=CefSharp, Version=1.21.0.17151, Culture=neutral, PublicKeyToken=null
  FusionLog==== Pre-bind state information ===
LOG: User = PatrickWisgerho\Patrick Wisgerhof
LOG: DisplayName = CefSharp, Version=1.21.0.17151, Culture=neutral, PublicKeyToken=null
 (Fully-specified)
LOG: Appbase = file:///D:/Chromium2/ataranto-CefSharp-1e37e78/Debug/
LOG: Initial PrivatePath = NULL
Calling assembly : CefSharp.Example, Version=1.21.0.17152, Culture=neutral, PublicKeyToken=null.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: D:\Chromium2\ataranto-CefSharp-1e37e78\Debug\CefSharp.Wpf.Example.vshost.exe.Config
LOG: Using host configuration file: 
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///D:/Chromium2/ataranto-CefSharp-1e37e78/Debug/CefSharp.DLL.
ERR: Failed to complete setup of assembly (hr = 0x8007000b). Probing terminated.

  StackTrace:
       at CefSharp.Wpf.Example.App..ctor()
       at CefSharp.Wpf.Example.App.Main() in D:\Chromium2\ataranto-CefSharp-1e37e78\CefSharp.Wpf.Example\obj\Debug\App.g.cs:line 0
       at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException: 

I read a little on the internet and found that this may be and win32 / x64 problem.

Also the libcef.dll file i build in the CEF project is 127.467 KB, its and lot bigger than any other libcef file i have seen in the CEFSharp projects.

Can you help me with this ?

Op donderdag 16 augustus 2012 19:38:08 UTC+2 schreef anthony taranto het volgende:

anthony taranto

unread,
Aug 20, 2012, 3:34:53 PM8/20/12
to cefs...@googlegroups.com
I haven't spent any time trying to build for .NET 4. A few public forks on github have converted to .NET 4.0, you may be interested in looking at their changes.


Also the libcef.dll file i build in the CEF project is 127.467 KB, its and lot bigger than any other libcef file i have seen in the CEFSharp projects.

Not sure what you mean by this, libcef.dll is > 20MB .

--Anthony

Deyan Varchev

unread,
Aug 21, 2012, 7:07:52 AM8/21/12
to cefs...@googlegroups.com
What you've found is problably the cause of the problem. This usually happens when a 64-bit process tries to load/execute 32-bit code. I guess your main executable (examples.wpf.exe) is compiled for AnyCPU and you run it on 64-bit machine. This makes it a 64-bit process and thus cannot load 32-bit cef. Try setting the debug build of the main exe project to compile only for x86. This should force everything to run in 32-bit mode. 

About the size - you probably meant 127.467 MB not KB. From my experience, the debug build of libcef is about that size (the pdb file is even bigger). However as Anthony mentions the release version is much smaller and you could you it in both debug and release builds of CefSharp.

Hope this helps.
Deyan

pattie103

unread,
Aug 23, 2012, 9:36:06 AM8/23/12
to cefs...@googlegroups.com
I tried your sugestion, and it works.

Thank you very much.

Op dinsdag 21 augustus 2012 13:07:52 UTC+2 schreef Deyan Varchev het volgende:
Reply all
Reply to author
Forward
0 new messages