Could not load file or assembly 'CefSharp.Core.dll' or one o

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

Could not load file or assembly 'CefSharp.Core.dll' or one o

Postby CodeMann » Sat Mar 17, 2018 11:03 am

32-bit Visual Studio 2010 on Windows 10-x64 using CefSharp from NuGet.
I've written a large C# 4.0 WinForms App in Visual Studio 2010. Some time ago I added the CEF framework (version 43.0.0.0) in order to utilize a web-browser inside my WinForms application.

ALL the dll's (version 43.0.0) are present in the bin\Release folder. If I start my program via Visual Studio and launch the browser, the browser works flawlessly. However, if I deploy the App via ClickOnce and attempt to launch the browser, I receive the familiar "Could not load file or assembly 'CefSharp.Core.dll' or one of its dependencies" error.

Per suggestions I found online, I downloaded VC++ 2012-x86 and created Bootstrapper product.xml and package.xml as a prerequisite. However, it still throws same error after ClickOnce deployment and launching the browser.

Could someone please offer suggestion(s) on what to do next, in order to have the browser launch post-deployment? I am at a complete loss as to what to do to get this working. Thanks
CodeMann
Newbie
 
Posts: 5
Joined: Sat Mar 17, 2018 10:35 am

Re: Could not load file or assembly 'CefSharp.Core.dll' or o

Postby payalord » Sun Mar 18, 2018 3:03 am

This sounds like ClickOnce deployment problem. And not CEF related, because you said if you start it via Visual Studio it's fine. Looks like ClickOnce deploying not all needed files with your App. And the one that is missing is exactly "CefSharp.Core.dll". But I'm not PRO here, this is just my thoughts :D
payalord
Techie
 
Posts: 21
Joined: Sun Jan 07, 2018 8:21 am

Re: Could not load file or assembly 'CefSharp.Core.dll' or o

Postby CodeMann » Thu Apr 05, 2018 4:23 pm

Hello Payalord
You were exactly right. It did turn out to be a ClickOnce issue. ClickOnce included all the "managed" resources, but did not include the unmanaged ones, i.e., cef.pak, cef_100_percent.pak, d3dcompiler, libcef.dll, icudtl.dat, etc.

If I right-clicked on References and attempted to browse to these resources to add them, Visual Studio complained about them being unmanaged and would not allow them to be added.

After working with the Microsoft ClickOnce and Deployment forum, it was suggested that I right-click on the project, Add > Existing Item and add them. Then set their Build Action to "Content" and Copy to Output Directory to "Copy Always."

This allowed the resources to show up in Application Files... on the Publish tab. After another ClickOnce deployment, launching the Web browser was successful. No more complaints about missing files. Thanks for pointing me in the right direction. :D
CodeMann
Newbie
 
Posts: 5
Joined: Sat Mar 17, 2018 10:35 am


Return to Support Forum

Who is online

Users browsing this forum: Google [Bot] and 44 guests