Serilog 缺少什么命名空间?

2024-01-09

I am able to use LoggerConfiguration() in my C# code with various Serilog Sinks but my compiler is complaining about the specification of my use of ".WriteTo.File". I am confused because I have ben able to use this specification in another demo solution. I wonder if there is some sort of Assembly I need to add as a reference. I have run "Install-Package Serilog.Sinks.File" from the "Package Manager Console" but that did not seem to have any effect or change.
enter image description here What directive am I missing or what assembly reference do I need? enter image description here I tried to figure this out via online documentation but I can not find the result.


您没有缺少名称空间。您缺少一个水槽...Serilog.Sinks.File https://github.com/serilog/serilog-sinks-file.

安装Serilog.Sinks.File https://www.nuget.org/packages/Serilog.Sinks.File/来自 NuGet 的包:

Install-Package Serilog.Sinks.File

每次使用时WriteTo。某物,您正在写入特定接收器,需要将其添加到您的项目中。

您可以在此处查看可以使用的可用接收器列表:https://github.com/serilog/serilog/wiki/Provided-Sinks https://github.com/serilog/serilog/wiki/Provided-Sinks

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Serilog 缺少什么命名空间? 的相关文章

随机推荐