Error - Mediachase.Commerce log4net Version=1.2.10.0 (Version 8.16)

Hi

I have a strange error in my installation of Episerver Commerce.

I have install all nuget packages, and for some developers are getting the error with log4net. We have try many things, but nothing works.

Have some have the same problem?

Here is the error:

Server Error in '/' Application.
 
While loading .NET types from "Mediachase.Commerce" the following error(s) was reported:
 
     - System.IO.FileLoadException: Could not load file or assembly 'log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
File name: 'log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821'
 
WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
 
 
 
  Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
 
Exception Details: EPiServer.Framework.Initialization.InitializationException: While loading .NET types from "Mediachase.Commerce" the following error(s) was reported:
 
     - System.IO.FileLoadException: Could not load file or assembly 'log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
File name: 'log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821'
 
WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
 
 
 
 
Source Error:
 
 
The source code that generated this unhandled exception can only be shown when compiled in debug mode. To enable this, please follow one of the below steps, then request the URL:
 
1. Add a "Debug=true" directive at the top of the file that generated the error. Example:
 
   <%@ page language="C#" debug="true">
 
or:
 
2) Add the following section to the configuration file of your application:
 
   
       
   
 
Note that this second technique will cause all files within a given application to be compiled in debug mode. The first technique will cause only that particular file to be compiled in debug mode.
 
Important: Running applications in debug mode does incur a memory/performance overhead. You should make sure that an application has debugging disabled before deploying into production scenario. 
 
Stack Trace:
 
 
 
[InitializationException: While loading .NET types from "Mediachase.Commerce" the following error(s) was reported:
 
     - System.IO.FileLoadException: Could not load file or assembly 'log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
File name: 'log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821'
 
WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
 
 
]
   EPiServer.Framework.Initialization.InitializationExceptionHelper.ThrowFriendlyTypeScannerException(IEnumerable`1 reflectionExceptions, IEnumerable`1 addonsWithErrors) +119
   EPiServer.Framework.Initialization.InitializationModule.Initialize(HostType hostType) +1439
   EPiServer.Framework.Initialization.InitializationModule.FrameworkInitialization(HostType hostType) +104
   EPiServer.Global..ctor() +110
   ASP.global_asax..ctor() +16
 
[TargetInvocationException: Exception has been thrown by the target of an invocation.]
   System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck) +0
   System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) +159
   System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) +256
   System.Activator.CreateInstance(Type type, Boolean nonPublic) +127
   System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark) +14407909
   System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) +198
   System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture) +28
   System.Web.HttpRuntime.CreateNonPublicInstance(Type type, Object[] args) +83
   System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +312
   System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +475
 
[HttpException (0x80004005): Exception has been thrown by the target of an invocation.]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +12618388
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +159
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +12458005
 
 
 
 
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.34248 

 

Any Ideas?

Thanks

#138939
Sep 23, 2015 21:05

Hi,

Which version of log4net do you have in the bin folder? What do you have in bindingRedirect (web.config)?

/Q

#138950
Sep 23, 2015 22:14

Hi Quan

We dont have any dependentAssembly in web.config to log4net.

We have vercion 1.2.13 on bin folder...

Juan

#138963
Sep 24, 2015 10:12

Hi,

I think that's the problem. Commerce 8.16.1 has a hard dependency on log4net 1.12.10 (this restriction is lifted in Commerce 8.17/CMS9).

What you can do now is to add this to your web.config/

      <dependentAssembly>
        <assemblyIdentity name="log4net" publicKeyToken="xxx" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-1.3.0.0" newVersion="1.2.13.0" />
      </dependentAssembly>

Regards,

/Q

#138964
Sep 24, 2015 10:18
Vote:

Hi Quan

Thanks for quick reply.

The thing is that we allready have a lognet of a specific vercion, and we are not able to upgrade och downgrade.

But I manage to fix this with gacutil.exe -i log4net.dll

This make possible to have 2 different vercion of the same dll.

Thanks

#138965
Sep 24, 2015 10:47
error This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.