c# - Could not load file or assembly 'CefSharp.Wpf for both x64 and x86; only one works -


when run get: could not load file or assembly 'cefsharp.wpf, version=41.0.0.0, culture=neutral, publickeytoken=40c4b6fc221f4138' or 1 of dependencies. attempt made load program incorrect format.
means problem due dlls not being correct bitness.

in version 41.0.0, nuget package adds dll references x86 version point correct path (an x86 folder). there copy of dlls point empty path in properties panel. problem x64 version crashes bad image error because referencing x86 versions of dlls.

i have tracked 39.0.2 , cefsharp works me. have both sets of dlls , x86 , x64 versions of application compile , run expected.

when upgrade again 41.0.0 same problem before. x64 version compile though application uses x86 versions of dll crashes when trying display first browser. tried rebuild removing dlls copied in automatically , during compilation x86 versions copied in again. (at least believe case a

two sets of dlls

i removed of dlls in references , manually added x64 versions. compilation , execution worked correctly did 39.02 version of cefsharp.wpf.

how can both versions work without having manually change dll paths?

another note: can use nuget while set x64 , makes opposite of above problem. x64 works , x86 doesn't. paths of dlls x64 folders.

it turns out, after tribulation , anguish, found references not setup correctly in .csproj. defined being x64 somehow.

<reference include="cefsharp, version=41.0.0.0, culture=neutral, publickeytoken=40c4b6fc221f4138, processorarchitecture=amd64">   <specificversion>false</specificversion>   <!--<hintpath>..\packages\cefsharp.common.41.0.0\cefsharp\x64\cefsharp.dll</hintpath>--> </reference> <reference include="cefsharp.core, version=41.0.0.0, culture=neutral, publickeytoken=40c4b6fc221f4138, processorarchitecture=amd64">   <specificversion>false</specificversion>   <!--<hintpath>..\packages\cefsharp.common.41.0.0\cefsharp\x64\cefsharp.core.dll</hintpath>--> </reference> <reference include="cefsharp.wpf, version=41.0.0.0, culture=neutral, publickeytoken=40c4b6fc221f4138, processorarchitecture=x86">   <specificversion>false</specificversion>   <!--<hintpath>..\packages\cefsharp.wpf.41.0.0\cefsharp\x64\cefsharp.wpf.dll</hintpath>--> </reference> 

as commented out hintpath, started working correctly. note actual references defined import @ top of project.

<import project="..\packages\cefsharp.wpf.41.0.0\build\cefsharp.wpf.props" condition="exists('..\packages\cefsharp.wpf.41.0.0\build\cefsharp.wpf.props')" /> <import project="..\packages\cefsharp.common.41.0.0\build\cefsharp.common.props" condition="exists('..\packages\cefsharp.common.41.0.0\build\cefsharp.common.props')" /> 

these .props files setup actual hintpath necessary copy correct .dlls on build folder. uncertain how project ended path set incorrectly.


Comments

Popular posts from this blog

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -

python - How to remove the Xframe Options header in django? -