问题
What namspace and I missing for Serilog?
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.
What directive am I missing or what assembly reference do I need?
I tried to figure this out via online documentation but I can not find the result.
回答1:
You only need to be
using Serilog;
The message you've shown suggests there's been some problem with the processing off the Add-Package
, which seems correct in outline - I'd be checking the NuGet references and seeing whether it's actually been applied; it's not going to work without it.
来源:https://stackoverflow.com/questions/55268525/what-namespace-am-i-missing-for-serilog