Skip to content

.AddRoundRobinLoadBalancer() causes NotSupportedException in .net5.0 #530

@antonpopov

Description

@antonpopov

When using .AddRoundRobinLoadBalancer() for client side load balancing in .net5.0 upon sending a http request an exception is thrown: NotSupportedException: BinaryFormatter serialization and deserialization are disabled within this application. See https://aka.ms/binaryformatter for more information.

Steps to reproduce

Steps to reproduce the behavior:

  1. Create an ASP.NET Core Web API project
  2. Configure a named http client to use DiscoveryHttpClientHandler and add .AddRoundRobinLoadBalancer().
services.AddHttpClient("test")
        .AddRoundRobinLoadBalancer()
        .ConfigurePrimaryHttpMessageHandler(sp => new DiscoveryHttpClientHandler(sp.GetService<IDiscoveryClient>()))
        .AddTypedClient<ITestService, TestService>();
  1. Make a request through the http client.

Environment:

  • Steeltoe Version [3.0.1]
  • .NET Version [.NET5.0]

Metadata

Metadata

Assignees

Labels

Component/DiscoveryIssues related to Steeltoe Service DiscoveryType/bugSomething isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions