question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Ocelot is not working with .NET Core 3

See original GitHub issue

Expected Behavior

the following method extension

public static IOcelotBuilder AddOcelot(this IServiceCollection services);
public static IOcelotBuilder AddOcelot(this IServiceCollection services, IConfiguration configuration);

add the Ocelot Gateway to the AspNetCore project.

Actual Behavior

throws an exception

System.TypeLoadException
  HResult=0x80131522
  Message=Could not load type 'Microsoft.Extensions.DependencyInjection.MvcJsonMvcCoreBuilderExtensions' from assembly 'Microsoft.AspNetCore.Mvc.Formatters.Json, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'.
  Source=Ocelot
  StackTrace:
   at Ocelot.DependencyInjection.OcelotBuilder..ctor(IServiceCollection services, IConfiguration configurationRoot)
   at Ocelot.DependencyInjection.ServiceCollectionExtensions.AddOcelot(IServiceCollection services, IConfiguration configuration)
   at OcelotApiGw.Startup.ConfigureServices(IServiceCollection services) in <path to source code file> line 73
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at Microsoft.AspNetCore.Hosting.ConfigureServicesBuilder.InvokeCore(Object instance, IServiceCollection services)
   at Microsoft.AspNetCore.Hosting.ConfigureServicesBuilder.<>c__DisplayClass9_0.<Invoke>g__Startup|0(IServiceCollection serviceCollection)
   at Microsoft.AspNetCore.Hosting.StartupLoader.ConfigureServicesDelegateBuilder`1.<>c__DisplayClass15_0.<BuildStartupServicesFilterPipeline>g__RunPipeline|0(IServiceCollection services)
   at Microsoft.AspNetCore.Hosting.ConfigureServicesBuilder.Invoke(Object instance, IServiceCollection services)
   at Microsoft.AspNetCore.Hosting.ConfigureServicesBuilder.<>c__DisplayClass8_0.<Build>b__0(IServiceCollection services)
   at Microsoft.AspNetCore.Hosting.StartupLoader.ConfigureServicesDelegateBuilder`1.<>c__DisplayClass14_0.<ConfigureServices>g__ConfigureServicesWithContainerConfiguration|0(IServiceCollection services)
   at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.ConfigureServices(IServiceCollection services)

possible related to this

Steps to Reproduce the Problem

  1. Try to add ocelot with the method extension.

Specifications

  • Version: 13.5.2
  • Platform: Windows, .NET Core SDK 3.0 preview8

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:13
  • Comments:13 (1 by maintainers)

github_iconTop GitHub Comments

18reactions
yzinccommented, Sep 28, 2019

Hi all! Do you know when upgrade to .net core 3.0 will be ready? I think not only I wait for this really important update

4reactions
hikalkancommented, Sep 17, 2019

Hi all. Any plan to move asp.net core 3.0 without @rynowak’s temporary solution…?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Integrating Ocelot 16.0 with ASP.Net Core 3.1 not working ...
I have used Ocelot with Asp.Net Core 2.1 and its working but when using with Asp.Net Core 3.1 it is not working at...
Read more >
Implementing API Gateways with Ocelot for .Net Core 3.1
Ocelot is an API Gateway based on the .NET Core framework and a rich set of features including: ; Prerequisites : ;. Docker...
Read more >
Implementing API Gateways with Ocelot
Ocelot is designed to work with ASP.NET Core only. The latest version of the package is 18.0 which targets .NET 6 and hence...
Read more >
Implementing API Gateway with Ocelot in ASP.NET Core
Here, we'll learn how to implement the Api Gateway with Ocelot, which is an open-source API Gateway, designed for microservices ...
Read more >
Ocelot route in asp.net 6.0!
Hi everyone I'm using ocelot to create a simple api gateway in my asp.net core 6.0. Here is my program.cs code : using...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found