在.Net Core中写入EventLog

问题描述 投票:9回答:3

我需要一种在使用dnx的应用程序中写入Windows事件查看器的方法。但是,EventLog类在System.Diagnostics名称空间中不可用,因此我陷入了困境。还有其他方法可以写入EventViewer吗?

c# logging .net-core dnx
3个回答
7
投票

NuGetMicrosoft.Extensions.Logging.EventLogVersion 2.1.1中添加


1
投票

好消息! EventLog已经为ported to corefx,将在.NET Core 2.1中可用。


1
投票

它在2.0中可用,但是您必须安装兼容包。https://github.com/dotnet/corefx/issues/25440

© www.soinside.com 2019 - 2024. All rights reserved.