Serilog's AddSerilog is not recognized

You may forget this following line in project.json

"Serilog.Extensions.Logging": "1.0.0",

See also https://carlos.mendible.com/2016/09/19/step-step-serilog-asp-net-core/


Different circumstance, but same problem. In my case, I was using .Net Core 2.1 and had a NuGet reference to Serilog, but was missing a reference to Serilog.AspNetCore. The issue first manifested as .UserSerilog() not being found for the IWebHostBuilder of my CreateWebHostBuilder static method under Program.cs.

Adding the Serilog.AspNetCore NuGet package to my project solved the problem.


The posted answer is correct but I will add that you may want to use the NuGet package manager that way you can get the latest version.

Right click on solution

-> Choose "Manage NuGet packages for solution"

-> type "serilog.extensions.logging" into search box

-> Click on Serilog.Extensions.Logging and press install

You will get a dropdownlist of the different versions you should choose the latest.

Or quicker from Package Manager console verify that Default Project drop-down has your project selected and run

install-package Serilog.Extensions.Logging