代码之家  ›  专栏  ›  技术社区  ›  Markus

在IIS 7.0上部署ASP.NET MVC项目时出现问题。错误图像格式异常

  •  0
  • Markus  · 技术社区  · 15 年前

    我一直在使用我的Web应用程序。从标题中可以看出,它是一个ASP.NET MVC(1,0)应用程序,所以我只做了两件需要做的事情,一件需要做的事情就是部署这样的应用程序。我创建了一个生成,并将其复制到了IIS文件夹中。在IDE(VS2008)中,所有的工作都很好:(.

    这工作了很长时间。但我知道我得到了一个错误,我所包括的其他项目的动态链接库。 (我有一个德语版本,所以这个错误是从谷歌SRY翻译过来的)

    BadImageFormatException: File or assembly 'DataService.WebInterface.BusinessLogic "or one of its dependencies was not found. An attempt was made to load a file with an incorrect format.]
       System.Reflection.Assembly._nLoad (AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark & stackMark, throwOnFileNotFound Boolean, Boolean forIntrospection) +0
       System.Reflection.Assembly.InternalLoad (AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark & stackMark, Boolean forIntrospection) +416
       System.Reflection.Assembly.InternalLoad (String String assemblyName, Evidence assemblySecurity, StackCrawlMark & stackMark, Boolean forIntrospection) +166
       System.Reflection.Assembly.Load (String string assemblyName) +35
       System.Web.Configuration.CompilationSection.LoadAssemblyHelper (String assemblyName, Boolean starDirective) +190
    

    那是什么意思?文件是否已损坏或必须更改web.config?

    感谢您的支持!

    1 回复  |  直到 15 年前
        1
  •  2
  •   PanJanek    15 年前

    这可能意味着该项目的目标平台(x86/x64)与服务器环境不同。在发布前更改vs中的目标平台以匹配您的服务器。 除此之外,在应用程序池中的IIS管理器中还有一个名为“启用32位应用程序”的高级设置-如果在64位环境中使用32B位程序集(或本机程序集),请将其更改为“真”。