gpt4 book ai didi

common.logging - 无法加载文件或程序集 Common.Logging

转载 作者:行者123 更新时间:2023-12-02 04:36:46 25 4
gpt4 key购买 nike

我编写了类库来支持使用 NLog 和 log4net 和 Common.Logging 编写日志。当我使用项目进行测试时,出现错误 Could not load file or assembly 'Common.Logging, Version=3.3.1.0, Culture=neutral, PublicKeyToken=af08829b84f0328e' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
刷新日志:

=== Pre-bind state information ===
LOG: DisplayName = Common.Logging, Version=3.3.1.0, Culture=neutral, PublicKeyToken=af08829b84f0328e
(Fully-specified)
LOG: Appbase = file:///C:/Source/Hits2000/Web-Applications/WinhitsWebApi/WinhitsWebApi.ApiService/
LOG: Initial PrivatePath = C:\Source\Hits2000\Web-Applications\WinhitsWebApi\WinhitsWebApi.ApiService\bin
Calling assembly : Common.Logging.Log4Net1211, Version=3.3.1.0, Culture=neutral, PublicKeyToken=af08829b84f0328e.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Source\Hits2000\Web-Applications\WinhitsWebApi\WinhitsWebApi.ApiService\web.config
LOG: Using host configuration file: C:\Users\Administrator\Documents\IISExpress\config\aspnet.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Post-policy reference: Common.Logging, Version=3.3.1.0, Culture=neutral, PublicKeyToken=af08829b84f0328e
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/root/f19f3155/f95cde26/Common.Logging.DLL.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/root/f19f3155/f95cde26/Common.Logging/Common.Logging.DLL.
LOG: Attempting download of new URL file:///C:/Source/Hits2000/Web-Applications/WinhitsWebApi/WinhitsWebApi.ApiService/bin/Common.Logging.DLL.
WRN: Comparing the assembly name resulted in the mismatch: Minor Version
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.

请帮我解决这个问题

最佳答案

我的 .Net 程序中也有类似的异常。我升级和降级了一些 nuget 软件包,这给了我错误和轻微的头痛。

我在我的 App.config 中改变了这个

        <dependentAssembly>
<assemblyIdentity name="Common.Logging" publicKeyToken="af08829b84f0328e" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.4.0.0" newVersion="3.4.0.0" />
</dependentAssembly>

对此
      <dependentAssembly>
<assemblyIdentity name="Common.Logging" publicKeyToken="af08829b84f0328e" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.3.1.0" newVersion="3.3.1.0" />
</dependentAssembly>

由于 nuget 升级,版本号已更改,并且在降级期间未恢复。

关于common.logging - 无法加载文件或程序集 Common.Logging,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41804887/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com