0

Hi I have a project in VB.NET and using log4Net exception handling. The project and log4net are working with no problems what so ever but when I try to add a DLL (not built by me) this seems to use the log4net component which is giving me the above error.

The other error I get is 'LogManager' is ambiguous in the namespace 'log4net'.

My code is as follows:

Imports Microsoft.VisualBasic
Imports System.Diagnostics
Imports log4net

Namespace Edge.Web.JOnline

Public Class Logger

    Private logger As ILog

    Public Sub New(_objectType As System.Type)
        logger = log4net.LogManager.GetLogger(_objectType)
    End Sub

End Class

End Namespace

Can anyone help me with a workaround?

Many thanks,

Leigh

leighhydes
  • 77
  • 1
  • 2
  • 8
  • Is the other component using a different version of log4net? – stuartd Jul 06 '15 at 09:26
  • Depending on which versions they are, you may be able to use a binding redirect, but as [the public key and API changed between 1.2.10 and 1.2.11](http://www.wiktorzychla.com/2012/03/pathetic-breaking-change-between.html) you may not - see [this question](http://stackoverflow.com/questions/3158928/referencing-2-differents-versions-of-log4net-in-the-same-solution/) for alternative options – stuartd Jul 06 '15 at 10:38

0 Answers0