找不到方法:'Serilog.LoggerConfiguration Serilog.LoggerConfigurationLogentriesExtensions.Logentries [英] Method not found: 'Serilog.LoggerConfiguration Serilog.LoggerConfigurationLogentriesExtensions.Logentries

查看:448
本文介绍了找不到方法:'Serilog.LoggerConfiguration Serilog.LoggerConfigurationLogentriesExtensions.Logentries的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在一个.net核心项目中,该项目使用一个名为NUGET的nuget软件包。该软件包引用serilog进行记录。到这里一切都很好。在图像中可以看到serilog的引用。

I am working on a .net core project which uses a nuget package say NUGET 1. The package references serilog for logging purpose. Everything works fine till here. The references of serilog can be seen in the image.

我添加了另一个nuget包说NUGET2。该项目仍在构建,但是这次我在下面看到一个运行时错误。

As soon as I add another nuget package say NUGET 2. The project still builds but this time I get a runtime error below.


未找到方法:'Serilog.LoggerConfiguration
Serilog.LoggerConfigurationLogentriesExtensions.Logentries(Serilog.Configuration.LoggerSinkConfiguration,
System.String,Boolean,Int32,System.Nullable`1,
Serilog.Events.LogEventLevel,System.String,System.IFormatProvider)'。

Method not found: 'Serilog.LoggerConfiguration Serilog.LoggerConfigurationLogentriesExtensions.Logentries(Serilog.Configuration.LoggerSinkConfiguration, System.String, Boolean, Int32, System.Nullable`1, Serilog.Events.LogEventLevel, System.String, System.IFormatProvider)'.

第二个nuget软件包的详细信息如下图所示。
我无法找出确切原因。

The details of second nuget package are in image below. I am unable to figure out exact reason for this.

推荐答案

这是由于两个nuget软件包中 serilog 版本的差异所致。我更新了第二个nuget包,使其指向相同版本的 serilog 。这为我解决了这个问题。
这里也描述了类似的问题未找到方法:'Serilog.LoggerConfiguration 并且解决方案也相同。

This was due to difference in version of serilog in both nuget packages. I updated the second nuget package to point to same version of serilog. This fixed the issue for me. The similar problem is also described here Method not found: 'Serilog.LoggerConfiguration and the solution for this is also the same.

这篇关于找不到方法:'Serilog.LoggerConfiguration Serilog.LoggerConfigurationLogentriesExtensions.Logentries的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆