title: System.IO.FileLoadException: 'Could not load file or assembly 'Serilog'
body: <p>Why I get </p>
  
  <blockquote>
    <p>System.IO.FileLoadException: 'Could not load file or assembly
    'Serilog, Version=1.5.0.0, Culture=neutral,
    PublicKeyToken=24c2f752a8e58a10' or one of its dependencies.</p>
  </blockquote>
  
  <p>When I try to load this assembly from out side project.</p>
  
  <p><a href="https://i.stack.imgur.com/PnTBO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PnTBO.png" alt="enter image description here"></a></p>
  
  <hr>
  
  <p>The folloing method is exist in a separate class library project, and I add reference of that <code>dll</code> to my <code>MVC project</code>.</p>
  
  <pre><code>public class LoggingConfig
      {
          public static void RegisterLog()
          {
              const string template = "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level}] {Indent:l}{Message}{NewLine}{Exception}";
              var logger = new LoggerConfiguration()
                           .MinimumLevel.Debug()
                           .WriteTo.Seq("http://localhost:657")
                           .CreateLogger();
  
              // Configure PostSharp Logging to use Serilog
              LoggingServices.DefaultBackend = new SerilogLoggingBackend(logger);
          }
  
  
      }
  </code></pre>