I have migrate my Web project from RC1 to RC2, but I'm having this error:
Unable to resolve service for type 'Microsoft.ApplicationInsights.TelemetryClient' while attempting to activate 'Microsoft.ApplicationInsights.AspNetCore.ExceptionTrackingMiddleware'.
Any ideas?
You need to add "Microsoft.ApplicationInsights.AspNetCore": "1.0.0-rc2-final"
to your project.json
and this to your Startup
class:
public void ConfigureServices(IServiceCollection services)
{
...
// Add framework services.
services.AddApplicationInsightsTelemetry(Configuration);
...
}
public void Configure(IApplicationBuilder app)
{
...
app.UseApplicationInsightsRequestTelemetry();
app.UseApplicationInsightsExceptionTelemetry();
...
app.UseMvc();
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With