2

为什么我得到

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

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

在此处输入图像描述


以下方法存在于一个单独的类库项目中,我将它的引用添加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);
        }


    }
4

0 回答 0