0

I'm in the process of trying to add logging to a .net core web api project, however when adding nlog v 4.4.0, I am getting an error indicating that it's not compatible with .net core v1 when I know it is.

Could someone tell me which portion may be causing the issue in the project.json file?

"Microsoft.ApplicationInsights.AspNetCore": "1.0.0",
"Microsoft.AspNetCore.Mvc": "1.0.1",
"Microsoft.AspNetCore.Mvc.Formatters.Xml": "1.0.1",
"Microsoft.AspNetCore.Mvc.Formatters.Json": "1.0.1",
"Microsoft.AspNetCore.Routing": "1.0.1",
"Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
"Microsoft.AspNetCore.Server.Kestrel": "1.0.1",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0",
"Microsoft.Extensions.Configuration.FileExtensions": "1.0.0",
"Microsoft.Extensions.Configuration.Json": "1.0.0",
"Microsoft.Extensions.Logging": "1.0.0",
"Microsoft.Extensions.Logging.Console": "1.0.0",
"Microsoft.Extensions.Logging.Debug": "1.0.0",
"Microsoft.Extensions.Options.ConfigurationExtensions": "1.0.0",
"NETStandard.Library": "1.6.0",
"System.Data.SqlClient": "4.1.0",
"NLog.Config": "4.4.0",
"NLog": "4.4.0"
Alex B
  • 23
  • 4

2 Answers2

1

You can use NLog.Web.AspNetCore 4.4.1 as today.

enter image description here

It seems that you are using old way of creating .Net Core app which uses project.json. New one uses .csproj file.

Migrating .NET Core projects to the .csproj format

Win
  • 61,100
  • 13
  • 102
  • 181
0

For .Net core you need NLog 5 (beta). See also http://nlog-project.org/2016/10/30/nlog-roadmap-netcore-structural-logging.html

For setting up, see Use NLog in ASP.NET Core application

Julian
  • 33,915
  • 22
  • 119
  • 174