加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > asp.Net > 正文

asp.net – 无法加载文件或程序集“log4net”或其依赖项之一

发布时间:2020-12-16 06:38:26 所属栏目:asp.Net 来源:网络整理
导读:我正在尝试创建一个水晶报告,我是该领域的新手.我从 this tutorial post创建了一个水晶报告,但它似乎不起作用. 我的错误是: Could not load file or assembly ‘log4net’ or one of its dependencies. An attempt was made to load a program with an inco
我正在尝试创建一个水晶报告,我是该领域的新手.我从 this tutorial post创建了一个水晶报告,但它似乎不起作用.

我的错误是:

Could not load file or assembly ‘log4net’ or one of its dependencies. An attempt was made to load a program with an incorrect format.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.BadImageFormatException: Could not load file or assembly ‘log4net’ or one of its dependencies. An attempt was made to load a program with an incorrect format.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Assembly Load Trace: The following information can be helpful to determine why the assembly ‘log4net’ could not be loaded.

解决方法

BadFormatImageException是您为32位体系结构编译程序时收到的错误,并将尝试加载64位库或反之亦然.从错误中,您可以参考log4net(一个众所周知的日志库). 首先,检查您正在创建应用程序的CPU类型(x86,x64,AnyCPU) 其次,检查log4net的位数(你应该引用你的应用程序的相同位数) 第三,检查运行的操作系统IIS. (如果是x64和您的应用程序32,请在应用程序池的高级设置部分中将“启用32位应用程序”设置为true)

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读