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

8.4k Views Asked by At

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);
}
1

There are 1 best solutions below

3
On

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.