【发布时间】:2017-01-15 08:54:07
【问题描述】:
我从事网络项目,我使用 VS2013。在解决方案中,我有 2 个项目,解决方案中所有项目的构建平台目标是 Any CPU。
当我在 Global.asax 文件中的某个位置启动解决方案时,我收到此错误:
Could not load file or assembly 'MapGuideDotNetApi' or one of its dependencies. An attempt was made to load a program with an incorrect format.
虽然所有 DLL 和依赖项都在 bin 文件夹中。
如果在 Visual Studio 中我检查了工具->选项->项目和解决方案->Web 项目-> Use the 64 bit version of IIS 中的选项,我没有收到任何错误。
我的问题是知道为什么会出现上述错误吗?
【问题讨论】:
-
什么是 MapGuideDotNetApi ?
-
@YashveerSingh 这是我使用的开源 dll。
-
你有那个 DLL 的 32 位版本吗?我怀疑不是。
-
@CodyGray 它们都是 64 位的
-
好吧,那就是问题所在。如果您明确使用 64 位版本的 IIS,您会说一切正常。但除此之外,它会启动 32 位版本的 IIS,找不到所需 DLL 的 32 位版本,结果失败。