2017-01-23 3 views
1

NLog를 사용하여 로그를 작성하고 Common.Logging을 사용하여 log4net을 지원하는 클래스 라이브러리를 작성했습니다. 내가 프로젝트를 테스트 할 때 나는 오류 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)파일 또는 어셈블리를로드 할 수 없습니다. Common.Logging

FlushLog를 얻을 :

=== 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. 

날 내 닷넷 프로그램에서 비슷한 예외를 가지고이 문제

답변

0

를 해결하는 데 도움이 바랍니다. 나는 약간의 nuget 꾸러미를 올리고 격하 시켰고, 그것은 나에게 오류와 가벼운 두통을 줬다.

나는 업그레이드 nuget 인해에 버전 번호가 변경 한이

 <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> 

에 제의 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> 

이 변화하고 다운 그레이드시에 복귀하지 않았다.