Strange log4net link error on boot after deployment

I get an attached error since I put the latest version of log4net (1.2.11.0) into my solution projects. This happens on the server right after deployment, and when I upgrade again, it just disappears until the next deployment. Please note that I tried the redirect code of the next version, but that did not help:

<runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="log4net" publicKeyToken="669e0ddf0bb1aa2a" culture="neutral" /> <bindingRedirect oldVersion="1.2.10.0" newVersion="1.2.11.0" /> </dependentAssembly> </assemblyBinding> 

This is the error I get:

Server error in application "/".

Failed to load file or assembly 'log4net, Version = 1.2.10.0, Culture = neutral, PublicKeyToken = 1b44e1d426115821' or one of its dependencies. The located assembly manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

Exception Details: System.IO.FileLoadException: Failed to load file or assembly 'log4net, Version = 1.2.10.0, Culture = neutral, PublicKeyToken = 1b44e1d426115821' or one of its dependencies. The located assembly manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

Source Error:

  Line 76: </script> Line 77: <form id="form1" runat="server"> Line 78: <asp:ScriptManager ID="radscriptmanager" runat="server"> Line 79: </asp:ScriptManager> Line 80: <asp:ContentPlaceHolder ID="cphAfterScriptManager" runat="server"> 

Source file: MainFront.Master Line: 78

Assembly load trace: The following information may be useful in determining why the assembly "log4net, Version = 1.2.10.0, Culture = neutral, PublicKeyToken = 1b44e1d426115821" cannot be loaded.

+6
source share
1 answer

I suspect that the reason for this may be that you have dependencies on 1.2.10 in your application, and the new version that you installed from log4net is incompatible due to the new signature key.

On 1.2.11, you will notice that another key was signed, which caused pain to many people. In the end, I returned to 1.2.10.

However, there is version 1.2.11, which was continued with the previous key. Just download it and do the following and everything should be in order.

 <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="log4net" publicKeyToken="1b44e1d426115821" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-1.2.10.0" newVersion="1.2.11.0"/> </dependentAssembly> </assemblyBinding> </runtime> 

You can get the new and old key from the following URL: http://logging.apache.org/log4net/download_log4net.cgi

+10
source

Source: https://habr.com/ru/post/921378/


All Articles