NLog 不适用于 Application Insights
NLog not working with Application Insights
我正在尝试让 NLog 与 Microsoft Application Insights 一起工作。我按照这里的说明操作:
How do I use Microsoft Application Insights with NLog (Target cannot be found: 'ApplicationInsights')
以上说明帮助我注册了一个 ApplicationInsights 目标,但是,现在我收到了这个错误:
Could not load file or assembly 'Microsoft.ApplicationInsights, Version=0.7.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Line 10: public class HomeController : Controller
Line 11: {
Line 12: private static Logger logger = LogManager.GetCurrentClassLogger();
Line 13:
我不太了解程序集是如何注册的,所以请原谅我的知识不足。我尝试从我的 Web 应用程序中删除然后重新添加 Application Insights,以及卸载并重新安装 ApplicationInsights.NLogTarget Nuget 包,但无济于事。
有什么建议吗?
请升级到 Microsoft.ApplicationInsights.NLogTarget
NuGet 包及其依赖项的最新版本(当前为 0.17.0)。
我正在尝试让 NLog 与 Microsoft Application Insights 一起工作。我按照这里的说明操作:
How do I use Microsoft Application Insights with NLog (Target cannot be found: 'ApplicationInsights')
以上说明帮助我注册了一个 ApplicationInsights 目标,但是,现在我收到了这个错误:
Could not load file or assembly 'Microsoft.ApplicationInsights, Version=0.7.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Line 10: public class HomeController : Controller
Line 11: {
Line 12: private static Logger logger = LogManager.GetCurrentClassLogger();
Line 13:
我不太了解程序集是如何注册的,所以请原谅我的知识不足。我尝试从我的 Web 应用程序中删除然后重新添加 Application Insights,以及卸载并重新安装 ApplicationInsights.NLogTarget Nuget 包,但无济于事。
有什么建议吗?
请升级到 Microsoft.ApplicationInsights.NLogTarget
NuGet 包及其依赖项的最新版本(当前为 0.17.0)。