<legend id='aWxUL'><style id='aWxUL'><dir id='aWxUL'><q id='aWxUL'></q></dir></style></legend>
  • <i id='aWxUL'><tr id='aWxUL'><dt id='aWxUL'><q id='aWxUL'><span id='aWxUL'><b id='aWxUL'><form id='aWxUL'><ins id='aWxUL'></ins><ul id='aWxUL'></ul><sub id='aWxUL'></sub></form><legend id='aWxUL'></legend><bdo id='aWxUL'><pre id='aWxUL'><center id='aWxUL'></center></pre></bdo></b><th id='aWxUL'></th></span></q></dt></tr></i><div id='aWxUL'><tfoot id='aWxUL'></tfoot><dl id='aWxUL'><fieldset id='aWxUL'></fieldset></dl></div>

  • <tfoot id='aWxUL'></tfoot>
      1. <small id='aWxUL'></small><noframes id='aWxUL'>

          <bdo id='aWxUL'></bdo><ul id='aWxUL'></ul>

        错误:无法加载 log4net 程序集

        Error: Could not load log4net assembly(错误:无法加载 log4net 程序集)

              <small id='IniQZ'></small><noframes id='IniQZ'>

                <legend id='IniQZ'><style id='IniQZ'><dir id='IniQZ'><q id='IniQZ'></q></dir></style></legend>
              1. <i id='IniQZ'><tr id='IniQZ'><dt id='IniQZ'><q id='IniQZ'><span id='IniQZ'><b id='IniQZ'><form id='IniQZ'><ins id='IniQZ'></ins><ul id='IniQZ'></ul><sub id='IniQZ'></sub></form><legend id='IniQZ'></legend><bdo id='IniQZ'><pre id='IniQZ'><center id='IniQZ'></center></pre></bdo></b><th id='IniQZ'></th></span></q></dt></tr></i><div id='IniQZ'><tfoot id='IniQZ'></tfoot><dl id='IniQZ'><fieldset id='IniQZ'></fieldset></dl></div>

                • <bdo id='IniQZ'></bdo><ul id='IniQZ'></ul>
                • <tfoot id='IniQZ'></tfoot>
                    <tbody id='IniQZ'></tbody>
                  本文介绍了错误:无法加载 log4net 程序集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在寻找解决这个错误:

                  <块引用>

                  无法加载文件或程序集 'log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=692fbea5521e1304' 或其依赖项之一.系统找不到指定的文件."此错误位于 web.config 文件中.

                  当我将 log4net.dll 复制到我的 webapp 的 bin 目录时,我得到一个

                  <块引用>

                  无法加载文件或程序集 'log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=692fbea5521e1304' 或其依赖项之一.找到的程序集的清单定义与程序集引用不匹配.

                  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 文件进行了更改.我仍然收到清单定义与程序集引用不匹配的错误.抛出此错误的代码是:

                  第 33 行:<CR:CrystalReportViewer ID="CrystalReportViewer1" runat="server" AutoDataBind="true"第 34 行:BestFitPage="True" ToolPanelView="None"/>

                  解决方案

                  这里有几个问题可以解决:

                  1. 32 位版本 log4net.dll 的公钥标记与 Crystal Reports 使用的公钥标记冲突.要验证您是否遇到此问题,请在所有 .csproj 文件中搜索692fbea5521e1304" - 如果您看到对 CrystalDecisions 的引用AND log4net 你有这个问题.
                  2. 32 位版本的 log4net.dll 与为 64 位或 AnyCPU 架构编译的 dll 发生冲突.如果您遇到此问题,您将找到如下所示的参考.您可以通过将应用程序池重新配置为以 32 位运行并检查应用程序是否运行来验证问题 - 如果运行,则说明您遇到了这个问题.

                  <块引用>

                  在 64 位中为我们工作的修复是获取最新的 log4net.dll,它实际上有一个新的 PublicKeyToken,替换你的 3rd 方 bin 文件夹中的 log4net.dll,并且将所有 log4net.dll 引用更改为如下所示:

                  <块引用>

                  I am looking to solve this error:

                  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.

                  When I copy log4net.dll to the bin directory of my webapp, I get a

                  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.

                  This error also occurs in the web.config file.

                  It's easy enough to change the version and the public key token to match the file so that the assembly loads correctly. When I do that, my website runs perfectly, except for when a reportViewer object is initialized. Then it throws the original error at the reportViewer tag, not the web.config.

                  My hypothesis is that if I install the requested version of log4net.dll, my problems will be solved. But I have no clue which file that it, or where to find it. I've checked the obvious by downloading log4net 1.2.10 and trying out every dll in the download.

                  I should mention that the website runs without issues on my development machine, but not when published to my server.

                  I'm running an asp.net website, .NET 4.0, IIS 7, on a Server 2008 R2 OS. I've installed Crystal Reports 13.0.1 for 64bit (my machine is 64bit).

                  How can I resolve this issue?

                  EDIT: In response to @Kevian's answer, I have made the change to my web.config file. I still get the error where the manifest definition doesn't match the assembly reference. The code that throws this error is:

                  Line 33:     <CR:CrystalReportViewer ID="CrystalReportViewer1" runat="server"   AutoDataBind="true"
                  Line 34:         BestFitPage="True" ToolPanelView="None" />
                  

                  解决方案

                  There are a couple of issues at play here that are resolvable:

                  1. The public key token for the 32bit version of log4net.dll clashes with the one used by Crystal Reports. To verify if you have this problem, do a search for "692fbea5521e1304" in all of your .csproj files - if you see references to CrystalDecisions AND log4net you have this problem.
                  2. The 32bit version of log4net.dll clashes with dlls that are compiled for 64-bit or AnyCPU architecture. If you have this problem, you will find the references that look like below. You can verify the problem by reconfiguring your application pool to run as 32bit and checking to see if the app runs - if it does, you have this problem.

                  <Reference Include="log4net, Version=1.2.10.0, Culture=neutral, 
                  

                  PublicKeyToken=692fbea5521e1304, processorArchitecture=x86" >

                  The Fix that worked for us in 64-bit was to get the latest log4net.dll which actually has a new PublicKeyToken, replace the log4net.dll in your 3rd party bin folder, AND change all of the log4net.dll references to look like so:

                  <Reference Include="log4net, Version=1.2.10.0, Culture=neutral,
                  

                  PublicKeyToken=1b44e1d426115821, processorArchitecture=MSIL">

                  这篇关于错误:无法加载 log4net 程序集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Performance overhead of using attributes in .NET(在 .NET 中使用属性的性能开销)
                  Accessing attribute info from DTE(从 DTE 访问属性信息)
                  c# Hide a property in datagridview with datasource(c#使用数据源隐藏datagridview中的属性)
                  Extract Display name and description Attribute from within a HTML helper(从 HTML 帮助器中提取显示名称和描述属性)
                  C# Attributes and their uses(C# 属性及其用途)
                  C# - Getting all enums value by attribute(C# - 按属性获取所有枚举值)
                  <legend id='NWyAZ'><style id='NWyAZ'><dir id='NWyAZ'><q id='NWyAZ'></q></dir></style></legend>

                  <i id='NWyAZ'><tr id='NWyAZ'><dt id='NWyAZ'><q id='NWyAZ'><span id='NWyAZ'><b id='NWyAZ'><form id='NWyAZ'><ins id='NWyAZ'></ins><ul id='NWyAZ'></ul><sub id='NWyAZ'></sub></form><legend id='NWyAZ'></legend><bdo id='NWyAZ'><pre id='NWyAZ'><center id='NWyAZ'></center></pre></bdo></b><th id='NWyAZ'></th></span></q></dt></tr></i><div id='NWyAZ'><tfoot id='NWyAZ'></tfoot><dl id='NWyAZ'><fieldset id='NWyAZ'></fieldset></dl></div>

                    • <tfoot id='NWyAZ'></tfoot>
                        <tbody id='NWyAZ'></tbody>

                          <bdo id='NWyAZ'></bdo><ul id='NWyAZ'></ul>
                        • <small id='NWyAZ'></small><noframes id='NWyAZ'>