Write to EventLog in .Net Core

徘徊边缘 提交于 2019-12-01 03:44:04
praveen

Add from NuGet Microsoft.Extensions.Logging.EventLog Version 2.1.1

CM> Install-Package Microsoft.Extensions.Logging.EventLog -Version 2.1.1

Include the namespace Microsoft.Extensions.Logging.EventLog in the Program.cs file

This resolved my problem.

Good news! EventLog is already ported to corefx and will be available in .NET Core 2.1.

Right now you can download a preview package System.Diagnostics.EventLog from their MyGet feed.

it is available in 2.0 but you have to install the compatibility pack. https://github.com/dotnet/corefx/issues/25440

Here for more information: https://blogs.msdn.microsoft.com/dotnet/2017/11/16/announcing-the-windows-compatibility-pack-for-net-core/

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!