1

I'm trying to use log4net in my project, so i configured the log4net, created an appender and created the ILog object, and even tried to write to the eventviewer and it worked, here is the definition of the ILog. But when I'm Trying to pass the log into another class, I get this exception :

Could not load file or assembly 'Common.Logging, Version=3.0.0.0. Culture=neutral...

private readonly ILog _log;

public Class()
{
    XmlConfigurator.Configure();
    _log = LogManager.GetLogger(Assembly.GetExecutingAssembly().GetName().Name);
    // This works.
    _log.Error("Test");

    triggerListener = new TriggerListener(_log);
}
Golan Kiviti
  • 3,895
  • 7
  • 38
  • 63

1 Answers1

3

You need to check if the file Common.Logging.dll is in the bin directory of your project.

If it is not there copy the file there. If it is there check the version of the .dll. It is probably not 3.0.0.0.

Hari Prasad
  • 16,716
  • 4
  • 21
  • 35
Peter
  • 27,590
  • 8
  • 64
  • 84
  • I dont have this dll, is this dll a part of log4net? – Golan Kiviti Feb 25 '16 at 07:07
  • 1
    No it is not part of log4net, common.logging is a logging framework on top of other logging frameworks. There has to be some reference somewhere in your project. – Peter Feb 25 '16 at 07:16
  • Well, I dont have it, and i cant seem to find it, i also use Quartz and i think it uses the Common.Logging, but how come it doesnt find it? – Golan Kiviti Feb 25 '16 at 09:04