title: Hangfire Configuration Issue (Common.Logging.Core & Common.Logging.LogManager)
body: <p>I have installed Hangfire via 'Manage NuGet Packages' option in Visual Studio 2012. I am using SQL Server 2008 R2 for one project and SQL Server 2012 Enterprise for another project. My project is compatible with .Net 4.0 so I couldn't download the latest Hangfire which is compatible with .Net4.5 so I downloaded Hangfire (.Net 4.0) via NuGet.</p>
  
  <p>I added a new Startup file as required by Owin &amp; Hangfire configuration. The file is as follows:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Web;
  using Hangfire;
  using Hangfire.SqlServer;
  using Microsoft.Owin;
  using Owin;
  
  /// &lt;summary&gt;
  /// Summary description for Startup
  /// &lt;/summary&gt;
  /// 
  [assembly: OwinStartup(typeof(MyProj.Startup))]
  namespace MyProj
  {
      public class Startup
      {
          public Startup()
          {
              //
              // TODO: Add constructor logic here
              //
          }
          public void Configuration(IAppBuilder app)
          {
              app.UseHangfire(config =&gt;
              {
                  config.UseSqlServerStorage("ASP_NETConnectionString");
                  config.UseServer();
              });
          }
      }
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>Hangfire installation automatically added following lines in the web.config:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>  &lt;runtime&gt;
      &lt;assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"&gt;
        &lt;dependentAssembly&gt;
          &lt;assemblyIdentity name="Common.Logging.Core" publicKeyToken="af08829b84f0328e" culture="neutral" /&gt;
          &lt;bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" /&gt;
        &lt;/dependentAssembly&gt;
        &lt;dependentAssembly&gt;
          &lt;assemblyIdentity name="System.Runtime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /&gt;
          &lt;bindingRedirect oldVersion="0.0.0.0-2.6.8.0" newVersion="2.6.8.0" /&gt;
        &lt;/dependentAssembly&gt;
        &lt;dependentAssembly&gt;
          &lt;assemblyIdentity name="System.Threading.Tasks" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /&gt;
          &lt;bindingRedirect oldVersion="0.0.0.0-2.6.8.0" newVersion="2.6.8.0" /&gt;
        &lt;/dependentAssembly&gt;
      &lt;/assemblyBinding&gt;
    &lt;/runtime&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>When I run the project, I receive following error on <strong><em>Line 29</em></strong>: </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>Could not load type 'Common.Logging.LogManager' from assembly 'Common.Logging.Core, Version=3.0.0.0, Culture=neutral, PublicKeyToken=af08829b84f0328e'. 
    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: System.TypeLoadException: Could not load type 'Common.Logging.LogManager' from assembly 'Common.Logging.Core, Version=3.0.0.0, Culture=neutral, PublicKeyToken=af08829b84f0328e'.
  
  Source Error: 
  
  
  
  Line 27:             app.UseHangfire(config =&gt;
  Line 28:             {
  Line 29:                 config.UseSqlServerStorage("ASP_NETConnectionString");
  Line 30:                 config.UseServer();
  Line 31:             });
   </code></pre>
  </div>
  </div>
  </p>
  
  <p>When I comment the dependent assembly for Common.Logging.Core in the web.config then I receive the following error on <strong><em>Line 30</em></strong>:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>Could not load file or assembly 'Common.Logging.Core, Version=2.2.0.0, Culture=neutral, PublicKeyToken=af08829b84f0328e' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) 
    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: System.IO.FileLoadException: Could not load file or assembly 'Common.Logging.Core, Version=2.2.0.0, Culture=neutral, PublicKeyToken=af08829b84f0328e' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
  
  Source Error: 
  
  
  
  Line 28:             {
  Line 29:                 config.UseSqlServerStorage("ASP_NETConnectionString");
  Line 30:                 config.UseServer();
  Line 31:             });
  Line 32:         }
   </code></pre>
  </div>
  </div>
  </p>
  
  <p>There seems to be a configuration issue (incompatibility) with different versions of the Common.Logging.Core dll, please note I only have one file in the bin folder for Common.Logging.Core (V3.0.0.0), I tried to find V2.2.0.0 to check if this would resolve the 'Could not load Common.Logging.LogManager' but I couldn't find this dll on the web, please advice.</p>
  
  <p>Please note that the installation didn't create HangFireConfig.cs file.</p>
  
  <p>Thanks for reading and any help would be highly appreciated.</p>