我正在尝试创建一个工作角色以使用 librets.net 从 RETS 服务器下载数据。librets.net 是 C++ 库 librets 的包装器。我尝试了 32 位和 64 位版本并按照这篇文章进行操作,但没有成功。我仍然收到 BadImageFormatException
我该如何解决这个问题?
我正在尝试创建一个工作角色以使用 librets.net 从 RETS 服务器下载数据。librets.net 是 C++ 库 librets 的包装器。我尝试了 32 位和 64 位版本并按照这篇文章进行操作,但没有成功。我仍然收到 BadImageFormatException
我该如何解决这个问题?
BadImageFormatExceptions
are almost always a 32 bit/64 bit incompatibility; If I were a betting man, I'd say you are binding the wrong version based on your Platform
configuration in Visual Studio.
Choosing "Any CPU" will result in an assembly that will be JITted into a 64 bit version when loaded into a 64 bit process and a 32 bit version when loaded into a 32 bit process
Choosing "x86" will always result in a 32 bit assembly
I'd be willing to bet you've got:
Try switching everything over to 32 bit first; x86
for Platform, use the 32 bit version of the library, etc.