简体   繁体   中英

How to Logging To SQL Server With NLog in .Net Core 3.1?

In .net Core 2.2 according to Nlog documentations i can write logs in sql server but after update .net Core to 3.1, that doesn't work.

My goal is recording logs in sql server and this doesn't matter what nuget package(nlog, serilog, elmah, log4net, ...) be used.

refer to this article . but you sure that you must add each 3 following packages:

NLog.Web.AspNetCore , System.Data.SqlClient , Microsoft.EntityFrameworkCore.Tools

as mr.Brando Zhang answered,i do steps according by article that mr.Brando Zhang shared.

my problem was that i didn't add the System.Data.SqlClient package and then i did the rest of the steps as mentioned in this article .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM