Skip to content
This repository has been archived by the owner on Mar 26, 2019. It is now read-only.

Exception registering JsonSerializerSettings conflicting with AppMetrics #2

Closed
alhardy opened this issue Feb 2, 2018 · 1 comment
Closed
Labels

Comments

@alhardy
Copy link
Contributor

alhardy commented Feb 2, 2018

From @jchannon on December 4, 2017 19:52

public void ConfigureServices(IServiceCollection services)
{
  services.AddSingleton(new JsonSerializerSettings { ContractResolver = new DefaultContractResolver { NamingStrategy = new CamelCaseNamingStrategy() }, NullValueHandling = NullValueHandling.Ignore});
}

Using Autofac I got the below error:

Cannot choose between multiple constructors with equal length 1 on type 'App.Metrics.Formatters.Json.Serialization.HealthStatusSerializer'. Select the constructor explicitly, with the UsingConstructor() configuration method, when the component is registered.

Removing Autofac and just using ASP.NET DI I got a exception about HealthStatusserializer and I think IClock

Copied from original issue: AppMetrics/AspNetCore#4

@alhardy alhardy added the bug label Feb 2, 2018
@alhardy
Copy link
Contributor Author

alhardy commented Feb 2, 2018

App Metrics has never registered JsonSerializerSettings. The older version of HealthStatusSerializer had two ctors, one of which had JsonSerializerSettings injected so DI could not work out which ctor to use.

This is no longer the case

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant