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 #4

Closed
jchannon opened this issue Dec 4, 2017 · 2 comments
Closed
Labels

Comments

@jchannon
Copy link

jchannon commented Dec 4, 2017

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

@alhardy alhardy added the bug label Dec 4, 2017
@alhardy alhardy added this to the 2.0.0 milestone Dec 14, 2017
@alhardy
Copy link
Contributor

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

@alhardy
Copy link
Contributor

alhardy commented Feb 2, 2018

This issue was moved to AppMetrics/AspNetCoreHealth#2

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

2 participants