Currently im working on new project using CefSharp.OffScreen.NETCore, but I've got issue running it in Rider. Project building successfully, but on run this exception appears:
System.BadImageFormatException: Could not load file or assembly 'CefSharp.Core.Runtime, Version=107.1.120.0, Culture=neutral, PublicKeyToken=40c4b6fc221f4138'. An attempt was made to load a program with an incorrect format.
Then I've tried to build and run it in Visual Studio and after rebuild it runs fine. This issue happens only with CefSharp package, other projects with absolutely different packages runs without any exceptions.
Running configuration is same in Visual Studio and Rider (Debug x64, but tried all available - nothing changes). As I think there is might be problem with Rider MSBuild configuration, it might pass wrong parameters to build project.
I've tried reinstall vc redist, clean project, run project with different configuration (x64, x86, AnyCPU, Prefer 32bit also tried), use "Pass VisualStudio parameters to build" parameter in Rider build settings, create new project with simple CefSharp usage, even run project in both IDEs on absolutely clean PC. Nothing of it didn't help. All packages CefSharp.OffScreen need are installed.
It will be nice to got an example what parameters Visual Studio use, so I can try pass them in Rider.
CodePudding user response:
You have added the nuget package chromiumembeddedframework.runtime.win-arm64 but I'm pretty sure you meant to add x64 :)