System.IO.FileLoadException:'无法加载文件或程序集'Serilog'

时间:2018-11-20 15:18:39

标签: c# asp.net-mvc exception serilog fileloadexception

我为什么得到

  

System.IO.FileLoadException:'无法加载文件或程序集   'Serilog,版本= 1.5.0.0,文化=中性,   PublicKeyToken = 24c2f752a8e58a10'或其依赖项之一。

当我尝试从外部项目加载此程序集时。

enter image description here


下面的方法存在于一个单独的类库项目中,我将对dll的引用添加到我的MVC project中。

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


    }

0 个答案:

没有答案
相关问题