I have a problem to implement Ocelot with .NET Core 3.0, when I try to add ocelot in my program class as the documentation specifies that should be done vs2019 shows me this error:
"IServiceCollection" doesn't contain a definition for "AddOcelot" or an accessible extension method "AddOcelot" that accepts a first argument of type "IServiceCollection" (is any directive using or an assembly reference missing?),
This error is also repeated for UseOcelot() method
public class Program
{
public static void Main(string[] args)
{
new WebHostBuilder()
.UseKestrel()
.UseContentRoot(Directory.GetCurrentDirectory())
.ConfigureAppConfiguration((context, config) =>
{
config
.SetBasePath(context.HostingEnvironment.ContentRootPath)
.AddJsonFile("appsettings.json", true, true)
.AddJsonFile($"appsettings.{context.HostingEnvironment.EnvironmentName}.json", true, true)
.AddJsonFile("ocelot.json")
.AddEnvironmentVariables();
}).ConfigureServices(s => {
s.AddOcelot().AddConsul();
}).ConfigureLogging((hostingContext, logging) =>
{
logging.AddConsole();
})
.UseIIS()
.Configure(app =>
{
app.UseOcelot().Wait();
})
.Build().Run();
}
}
what can I do to solve this Error?, I already installed the Nuget packages Ocelot version 13.8.0 and Ocelot.Provider.Consul version 13.8.0.
using Ocelot.DependencyInjection; using Ocelot.Middleware;- Nkosi