When I run I get: Could not load file or assembly 'CefSharp.Wpf, Version=41.0.0.0, Culture=neutral, PublicKeyToken=40c4b6fc221f4138' or one of its dependencies. An attempt was made to load a program with an incorrect format.
This means the problem is due to the dlls not being correct bitness.
In version 41.0.0, the nuget package adds dll references to the x86 version which point to the correct path (an x86 folder). There are also another copy of dlls that point to an empty path in the properties panel. The problem is that the x64 version crashes with a bad image error because it is referencing the x86 versions of the dlls.
I have back tracked to 39.0.2 and CefSharp works for me. I have both sets of dlls and where x86 and x64 versions of my application compile and run as expected.
When I upgrade again to 41.0.0 same problem as before. The x64 version will compile though the application uses x86 versions of the dll which crashes when trying to display the first browser. I tried to rebuild all as well as removing the dlls that are copied in automatically and during the compilation the x86 versions are copied in again. (At least I believe this is the case a
I then removed all of the dlls in the references and manually added the x64 versions. The compilation and execution worked correctly as it did with the 39.02 version of CefSharp.WPF.
How can I get both versions to work without having to manually change the dll paths?
Another note: I can use nuget while set to x64 and this makes the opposite of the above problem. Now x64 works and x86 doesn't. The paths of the dlls are now x64 folders.
Nuget
package structure between39.0.2
and41.0.0
, it's really a very minor upgrade inCefSharp
terms (obviously a major upgrade to a newCEF
version). – Gamali