Open Simkortet opened 1 month ago
Hmm. That's weird. It would be interesting to see what the contents of builder.Services
looks like in the following spots:
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();
< -- here -- >
builder.Services.AddScoped<IFake, FakeService>();
builder.Services.Decorate<IFake, FakeDecorateService>();
< -- here -- >
builder.Services.AddApplicationInsightsTelemetry();
< -- here -- >
var app = builder.Build();
results in an exception because the TelemetryClient was not registered.
What does the exception say? Which type is it trying to resolve, exactly?
I have had the same issue - added Scrutor to my API and Application Insights stopped working. Moving AddApplicationInsightsTelemetry
to before decorating fixed the issue - thanks.
I'm experiencing a strange issue in my projects after upgrading package version from 4.2.2 to 5.0.1.
I created the basic weather app web application template to replicate:
Calling the weather endpoint results in an exception because the TelemetryClient was not registered. Note that calling
builder.Services.AddApplicationInsightsTelemetry();
before.Decorate<,>
works.