I've got a problem after I added the Logz.io log4net plugin (Logzio.DotNet.Log4net
) to my .NET project:
log4net:ERROR Failed to find type [log4net.Layout.SerializedLayout, log4net.Ext.Json]System.IO.FileLoadException: Could not load file or assembly 'log4net, Version=2.0.9.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a'. The located assembly's manifest definition does not match the assembly reference. (0x80131040)File name: 'log4net, Version=2.0.9.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a' at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, StackCrawlMarkHandle stackMark, ObjectHandleOnStack assemblyLoadContext, Boolean loadTypeFromPartialName, ObjectHandleOnStack type, ObjectHandleOnStack keepalive) at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, StackCrawlMark& stackMark, AssemblyLoadContext assemblyLoadContext, Boolean loadTypeFromPartialName) at System.RuntimeType.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase, StackCrawlMark& stackMark) at System.Type.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase) at log4net.Util.SystemInfo.GetTypeFromString(Assembly relativeAssembly, String typeName, Boolean throwOnError, Boolean ignoreCase) at log4net.Repository.Hierarchy.XmlHierarchyConfigurator.CreateObjectFromXml(XmlElement element, Type defaultTargetType, Type typeConstraint)log4net:ERROR Failed to create object to set param: layoutlog4net:ERROR Could not create Appender [LogzioAppender] of type [Logzio.DotNet.Log4net.LogzioAppender, Logzio.DotNet.Log4net]. Reported error follows.System.IO.FileLoadException: Could not load file or assembly 'log4net, Version=2.0.12.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a'. The located assembly's manifest definition does not match the assembly reference. (0x80131040)File name: 'log4net, Version=2.0.12.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a' at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, StackCrawlMarkHandle stackMark, ObjectHandleOnStack assemblyLoadContext, Boolean loadTypeFromPartialName, ObjectHandleOnStack type, ObjectHandleOnStack keepalive) at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, StackCrawlMark& stackMark, AssemblyLoadContext assemblyLoadContext, Boolean loadTypeFromPartialName) at System.RuntimeType.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase, StackCrawlMark& stackMark) at System.Type.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase) at log4net.Util.SystemInfo.GetTypeFromString(Assembly relativeAssembly, String typeName, Boolean throwOnError, Boolean ignoreCase) at log4net.Repository.Hierarchy.XmlHierarchyConfigurator.ParseAppender(XmlElement appenderElement)
In short, [log4net.Layout.SerializedLayout, log4net.Ext.Json]
is requesting log4net version 2.0.9.0
, while [Logzio.DotNet.Log4net.LogzioAppender, Logzio.DotNet.Log4net]
is requesting log4net version 2.0.12.0
So in this case I understand the problem clearly, but don't know how to resolve it. I've never seen this before, usually, NuGet does a good job by itself.
Ideally, it'd be great to get both to use log4net 2.0.13.0
, which is the latest version at the time of this post, but I'd be happy learning how I can resolve this issue in general.
Any ideas or solutions? Thanks!