我期待解决这个错误:当我复制log4net.dll我的web应用程序的bin目录错误:无法加载log4net的装配
Could not load file or assembly 'log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=692fbea5521e1304' or one of its dependencies. The system cannot find the file specified." This error is located in the web.config file.
,我得到一个
Could not load file or assembly 'log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=692fbea5521e1304' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference.
这web.config文件中也会出现错误。
很容易更改版本和公钥标记以匹配文件,以便程序集正确加载。当我这样做时,我的网站完美运行,除了初始化reportViewer
对象时。然后它会在reportViewer标记处引发原始错误,而不是web.config。
我的假设是,如果我安装log4net.dll
的请求版本,我的问题将得到解决。但我不知道哪个文件或哪里可以找到它。我已经通过下载log4net 1.2.10检查了明显的情况,并尝试了下载中的每个dll。
我应该提到网站在我的开发机器上运行时没有问题,但是在发布到我的服务器时没有问题。
我在Server 2008 R2操作系统上运行一个asp.net网站,.NET 4.0,IIS 7。我已经为64位安装了Crystal Reports 13.0.1(我的机器是64位)。
我该如何解决这个问题?
编辑: 回复@ Kevian的回答,我已经改变了我的web.config文件。清单定义与程序集引用不匹配时,仍然出现错误。引发此错误的代码是:
Line 33: <CR:CrystalReportViewer ID="CrystalReportViewer1" runat="server" AutoDataBind="true"
Line 34: BestFitPage="True" ToolPanelView="None" />
是一个解决方案发现了什么? – tomfanning 2013-01-28 14:57:05