Simple CefSharp application is missing files at runtime
Asked Answered
C

3

3

This is probably a very simple question. I copied the example CefSharp MinimalExample.WinForms project to a new directory and renamed to WinProxy. It builds ok. When I run it I get;

An unhandled exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.dll Additional information: Could not load file or assembly 'CefSharp.Core.dll' or one of its dependencies. The specified module could not be found.

Comparing with the example directory, I am missing a number of files listed here https://github.com/cefsharp/CefSharp/wiki/Output-files-description-table-(Redistribution)

I do have CefSharp.Core.dll, CefSharp.WinForms.dll and CefSharp.dll which were all referenced in the example project.

How do I get the rest? I tried copying them over and rebuilding but I get;

An unhandled exception of type 'System.IO.FileLoadException' occurred in mscorlib.dll Additional information: A procedure imported by 'CefSharp.Core.dll' could not be loaded.

Thanks.

Cordes answered 23/11, 2015 at 11:28 Comment(9)
Did CefSharp.MinimalExample.WinForms run before you made your modifications? The unmanaged dependencies are copied by the Nuget package on build. Try removing the CefSharp.WinForms package and reinstalling it.Coquetry
I uninstalled all the NuGet packages and then tried to reinstall them. cef.redist.x64 & cef.redist.x86 installed but CefSharp.Common won't. It says, Unable to resolve dependencies. 'cef.redist.x64 3.2526.1347' is not compatible with 'CefSharp.Common 45.0.0 constraint: cef.redist.x64 (= 3.2454.1344)'Cordes
Check your packages source, make sure Nuget.org is ticked.Coquetry
myget.org/F/cefsharp and nuget.org/api/v2 are ticked in VS tools->options->NuGet Package ManagerCordes
If you untick the myget feed things should start to work again. I'm in the process of releasing the next release version 45.0.0, so you've kinda been caught in a limbo period where packages haven't been uploaded to Nuget.org yet. Also incase your not aware, CefSharp required VC++ to run, see github.com/cefsharp/CefSharp#version-branches for details.Coquetry
Thanks for your help. I can't seem to find cef.redist.x86 on NuGet, it is a dependency of Cef.Sharp.Common even though right now I would be happy with only x64.Cordes
nuget.org/packages/cef.redist.x86Coquetry
The 45.0.0 release is up on Nuget.org now, it might be worth re downloading the MinimalExample, making sure it works, then making your modifications.Coquetry
Let us continue this discussion in chat.Cordes
C
0

After discussions with @amaitland I ended up uninstalling all NuGet packages and installing each package through the Package Manager Console;

Install-Package cef.redist.x86
Install-Package cef.redist.x64
Install-Package CefSharp.Common
Install-Package CefSharp.WinForms

It then worked.

Cordes answered 24/11, 2015 at 2:7 Comment(0)
C
6

Install:

  • Visual C++ Redistributable Packages for Visual Studio 2013

Check:

  • CefSharp Version 49.0.1 require Framework 4.5.1.
  • CefSharp Version 51.0.0 require Framework 4.5.2 or later.

Compile Solution:

  • x86 or x64
Consistency answered 27/9, 2016 at 19:16 Comment(1)
I was missing the Redistributable Package. Thank you!Omegaomelet
B
1

Try check whether you have all following dependencies included? enter image description here

Betjeman answered 23/11, 2015 at 12:58 Comment(2)
If everything installed properly, you will find all above mentioned dll'sBetjeman
Can you please edit the answer to reflect where those dlls are coming from ie (packages.config or other sys dependencies that need to be installed)Restorative
C
0

After discussions with @amaitland I ended up uninstalling all NuGet packages and installing each package through the Package Manager Console;

Install-Package cef.redist.x86
Install-Package cef.redist.x64
Install-Package CefSharp.Common
Install-Package CefSharp.WinForms

It then worked.

Cordes answered 24/11, 2015 at 2:7 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.