gpt4 book ai didi

c# - 使用 CefSharp 构建 x64 项目

转载 作者:行者123 更新时间:2023-11-30 23:00:27 25 4
gpt4 key购买 nike

我尝试编译我的应用程序,它具有 CefSharp 作为依赖项。以 x86 为目标时一切正常,但对于 x64,我收到以下错误:

System.BadImageFormatException: 'Could not load file or assembly 'CefSharp, Version=67.0.0.0, Culture=neutral, PublicKeyToken=40c4b6fc221f4138' or one of its dependencies. An attempt was made to load a program with an incorrect format.'

有什么想法吗?谢谢。

这是我在 VS 2017 中的配置设置的屏幕截图,

enter image description here

和项目属性的构建选项卡:

enter image description here

最佳答案

Hans Passant 在评论中写道:

The solution platform name is irrelevant for C# projects. There is only one setting that matters and its value is not related to the platform name. Right-click your EXE project > Properties > Build tab. You only get 64-bit execution with Platform target = AnyCPU and Prefer 32-bit unticked. You probably have "Prefer 32-bit" ticked now (the default), so kaboom when it tries to load x64 unmanaged code.

这正是问题所在。谢谢汉斯!

关于c# - 使用 CefSharp 构建 x64 项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51556943/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com