C# 错误原因:无法加载文件或程序集'';或者它的一个依赖项

C# 错误原因:无法加载文件或程序集'';或者它的一个依赖项,c#,.net,dll,x86,64-bit,C#,.net,Dll,X86,64 Bit,我在从事web项目时使用VS2013。在解决方案中,我有两个项目,解决方案中所有项目的构建平台目标都是任何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和依赖项

我在从事web项目时使用VS2013。在解决方案中,我有两个项目,解决方案中所有项目的构建平台目标都是
任何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项目->
中的选项,则使用64位版本的IIS
不会出现任何错误


我的问题是,你知道我为什么会出现上述错误吗

请检查您的web.config,它应该在
运行时
xml节点中包含程序集

<?xml version="1.0" encoding="utf-8"?>
<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=301880
  -->
<configuration> 
<!--whatever goes here-->
<runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="MapGuideDotNetApi" publicKeyToken="some token" />
        <bindingRedirect oldVersion="some old version" newVersion="some new version" />
      </dependentAssembly>
      <!--other assemblies-->
    </assemblyBinding>
    <!--whatever-->
</runtime>
<!--whatever goes here-->
</configuration>


为了让程序集显示在此处,我建议删除并添加已断开的引用。

什么是MapGuideDotNetApi?@Yashviersingh我使用的是开源dll。您有该dll的32位版本吗?我怀疑不是。@CodyGray他们都是64位的,那就是问题所在。如果显式使用64位版本的IIS,则表示一切正常。但否则,它会启动32位版本的IIS,找不到所需DLL的32位版本,结果失败。当我将块添加到webconfig时,会出现以下错误:应用程序配置文件“Web.config”无效。assemblyIdentity元素的某些属性不正确。当您添加对项目的引用时,应自动添加该元素。是否可以提供更多信息?可能是堆栈跟踪?它是如何使用的,有哪些功能?