dc

dc

  • NA
  • 663
  • 0

Error 19 'LogManager' is an ambiguous reference between LogManager'

Nov 13 2012 6:41 PM
I am getting the error message,"Error 19 'LogManager' is an ambiguous reference between 'Common.Logging.LogManager' and 'NLog.LogManager'".
In a C# 2008 application I am trying to add nlog open source logging tool to an application that is already using common.logging that was obtained from the following location: http://netcommon.sourceforge.net.
I have added a reference to the NLog file and I have added the Nlog to the using statement.
The problem is both tools use an object called 'LogManager'.
Thus can you tell me how to solve my problem so I can use both Logmanagers.
The following is my code listed below: xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 
The following is the code:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <configSections>
  <sectionGroup name="common">
  <section name="logging" type="Common.Logging.ConfigurationSectionHandler, Common.Logging" />
  </sectionGroup>
  </configSections>
  <nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <targets>
  </targets>
  <rules>
  </rules>
  </nlog>

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Common.Logging;
using sample;
using System.Configuration;
using System.Xml.Linq; 
using NLog;
namespace sample
{
  public class Etest
  {
  private static Logger logger = LogManager.GetCurrentClassLogger();
  private static ILog log = LogManager.GetCurrentClassLogger();
}
}


Answers (1)