zoukankan      html  css  js  c++  java
  • 【IIS错误】未能加载文件或程序集“AAAAA”或它的某一个依赖项。试图加载格式不正确的程序。


    未能加载文件或程序集“AAAAA”或它的某一个依赖项。试图加载格式不正确的程序。

    说明: 执行当前 Web 请求期间,出现未经处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。

    异常详细信息: System.BadImageFormatException: 未能加载文件或程序集“AAAAA”或它的某一个依赖项。试图加载格式不正确的程序。

    源错误:

    执行当前 Web 请求期间生成了未经处理的异常。可以使用下面的异常堆栈跟踪信息确定有关异常原因和发生位置的信息。


    程序集加载跟踪: 下列信息有助于确定程序集“AAAAA”未能加载的原因。

    警告: 程序集绑定日志记录被关闭。
    要启用程序集绑定失败日志记录,请将注册表值 [HKLMSoftwareMicrosoftFusion!EnableLog] (DWORD)设置为 1。
    注意: 会有一些与程序集绑定失败日志记录关联的性能损失。
    要关闭此功能,请移除注册表值 [HKLMSoftwareMicrosoftFusion!EnableLog]。
    


    堆栈跟踪:

    [BadImageFormatException: 未能加载文件或程序集“AAAAA”或它的某一个依赖项。试图加载格式不正确的程序。]
       System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +0
       System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection, Boolean suppressSecurityChecks) +567
       System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +192
       System.Reflection.Assembly.Load(String assemblyString) +35
       System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +118
    
    [ConfigurationErrorsException: 未能加载文件或程序集“AAAAA”或它的某一个依赖项。试图加载格式不正确的程序。]
       System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +11392147
       System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +484
       System.Web.Configuration.AssemblyInfo.get_AssemblyInternal() +127
       System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +334
       System.Web.Compilation.BuildManager.CallPreStartInitMethods() +280
       System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +1087
    
    [HttpException (0x80004005): 未能加载文件或程序集“AAAAA”或它的某一个依赖项。试图加载格式不正确的程序。]
       System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +11524352
       System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +141
       System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +4782309
    
    原因:操作系统是64位的,但发布的程序引用了一些32位的ddl,所以出现了兼容性的问题
    解决方案一:如果是64位机器,IIS——应用程序池——高级设置——启用32位应用程序 :true。
    解决方案二:修改项目属性——生成——目标平台(比如,X86X64)
  • 相关阅读:
    GCD
    SQLite
    将博客搬至CSDN
    Extjs 4 总结
    spring mvc 复杂参数注入
    7/12 聊天室结束
    7/10
    7/6一些知识点
    随便写写
    spring boot 入门操作(三)
  • 原文地址:https://www.cnblogs.com/Alenliu/p/3955775.html
Copyright © 2011-2022 走看看