问题
We are targeting netcoreapp1.1 and have referenced nuget package Microsoft.ApplicationInsights.AspNetCore with version 2.1.0-beta1 (currently the newest).
In program.cs we have .UseApplicationInsights()
and in Startup.cs:ConfigureServices we have services.AddApplicationInsightsTelemetry(this.Configuration);
.
We've tried adding new DependencyTrackingTelemetryModule().Initialize(TelemetryConfiguration.Active);
but still don't see any dependency calls, like sql commands, in the Application Map nor in any other reports.
We are using Entity Framework Core 1.1.1.
In Visual Studio when I F5 I see all database calls in the Diagnostic Tools window under ADO.NET. I also see Application Insights calls but those seem to be launched only for page loads, not for any dependencies.
Is this even supported yet and if it is, how do I enable it?
回答1:
HTTP dependencies with netcoreapp1.1 will be supported in 2.1-Beta2 release that will shortly be available on Nuget.org. This version is already available on myget, but may be not the final build.
Entity Framework Core dependencies tracking is currently not supported. If you would like to implement it yourself (and maybe even contribute !) you can use this PR as a starting point: https://github.com/Microsoft/ApplicationInsights-aspnetcore/pull/297.
Tracking issue for EF support: https://github.com/Microsoft/ApplicationInsights-dotnet-server/issues/522
来源:https://stackoverflow.com/questions/43674695/how-to-enable-dependency-tracking-with-application-insights-in-an-asp-net-core-p