I'm trying to create a very simple API with .net Core, and am exploring Kestrel. I am following the directions on this MS tutorial: https://learn.microsoft.com/en-us/aspnet/core/fundamentals/servers/kestrel?view=aspnetcore-2.2
However, when I try to call the ConfigureKestrel method, Visual Studio tells me that "IWebHostBuilder does not contain a definition for 'ConfigureKestrel()' and no accessible extension method for ConfigureKestrel accepting a first argument of the type 'IWebHostBuilder' could be found (are you missing a using directive or an assembly reference?)"
I can't find any info on this, and I'm fairly sure I'm using the right libraries. Any help would be greatly appreciated - code is included:
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
namespace WebApplication2
{
public class Program
{
public static void Main(string[] args)
{
CreateWebHostBuilder(args).Build().Run();
}
public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
WebHost.CreateDefaultBuilder(args)
.UseStartup<Startup>()
.ConfigureKestrel((context, options) =>
{
// Error with ConfigureKestrel method above
});
}
}