From 843d7e973af18b6c5c89ce4a7f9d99121cd2e710 Mon Sep 17 00:00:00 2001 From: Timothy Mothra Date: Fri, 21 Feb 2020 13:45:33 -0800 Subject: [PATCH 1/2] fix for AspNetCore AddApplicationInsightsSettings() and MissingMethodException (#1703) * fix for AspNetCore AddApplicationInsightsSettings() and MissingMethodException * fix --- CHANGELOG.md | 9 +++++++++ .../Extensions/ApplicationInsightsExtensions.cs | 17 ++++++++++++++--- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 35645df391..4e69f81f24 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,9 @@ ## VNext +## Version 2.14.0-beta2 +- [Fix: AspNetCore AddApplicationInsightsSettings() and MissingMethodException](https://github.com/microsoft/ApplicationInsights-dotnet/issues/1702) + ## Version 2.14.0-beta1 - [Support new conventions for EventHubs from Azure.Messaging.EventHubs and processor.](https://github.com/microsoft/ApplicationInsights-dotnet/pull/1674) - [Adding a flag to DependencyTrackingTelemetryModule to enable/disable collection of SQL Command text.](https://github.com/microsoft/ApplicationInsights-dotnet/pull/1514) @@ -10,6 +13,9 @@ - [change references to log4net to version 2.0.8](https://github.com/microsoft/ApplicationInsights-dotnet/issues/1675) - [Fix: PerformanceCounter implementation is taking large memory allocation](https://github.com/microsoft/ApplicationInsights-dotnet/issues/1694) +## Version 2.13.1 +- [Fix: AspNetCore AddApplicationInsightsSettings() and MissingMethodException](https://github.com/microsoft/ApplicationInsights-dotnet/issues/1702) + ## Version 2.13.0 - no changes since beta. @@ -28,6 +34,9 @@ - [Fix CreateRequestTelemetryPrivate throwing System.ArgumentOutOfRangeException](https://github.com/microsoft/ApplicationInsights-dotnet/issues/1513) - [NLog supports TargetFramework NetStandard2.0 and reduces dependencies](https://github.com/microsoft/ApplicationInsights-dotnet/pull/1522) +## Version 2.12.2 +- [Fix: AspNetCore AddApplicationInsightsSettings() and MissingMethodException](https://github.com/microsoft/ApplicationInsights-dotnet/issues/1702) + ## Version 2.12.1 - [Fix Endpoint configuration bug affecting ServerTelemetryChannel and QuickPulseTelemetryModule](https://github.com/microsoft/ApplicationInsights-dotnet/issues/1648) diff --git a/NETCORE/src/Shared/Extensions/ApplicationInsightsExtensions.cs b/NETCORE/src/Shared/Extensions/ApplicationInsightsExtensions.cs index 7fb1d83811..e38f3f6119 100644 --- a/NETCORE/src/Shared/Extensions/ApplicationInsightsExtensions.cs +++ b/NETCORE/src/Shared/Extensions/ApplicationInsightsExtensions.cs @@ -158,14 +158,25 @@ public static IServiceCollection ConfigureTelemetryModule( /// Enables or disables developer mode. /// Sets telemetry endpoint address. /// Sets instrumentation key. - /// Sets connection string. /// The . + public static IConfigurationBuilder AddApplicationInsightsSettings(this IConfigurationBuilder configurationSourceRoot, bool? developerMode = null, string endpointAddress = null, string instrumentationKey = null) + => configurationSourceRoot.AddApplicationInsightsSettings(connectionString: null, developerMode: developerMode, endpointAddress: endpointAddress, instrumentationKey: instrumentationKey); + + /// + /// Adds Application Insight specific configuration properties to . + /// + /// The instance. + /// Sets connection string. + /// Enables or disables developer mode. + /// Sets telemetry endpoint address. + /// Sets instrumentation key. + /// The . public static IConfigurationBuilder AddApplicationInsightsSettings( this IConfigurationBuilder configurationSourceRoot, + string connectionString, bool? developerMode = null, string endpointAddress = null, - string instrumentationKey = null, - string connectionString = null) + string instrumentationKey = null) { if (configurationSourceRoot == null) { From a2c381e04e9dfcab846a1f1447b6a0f17b1eaf84 Mon Sep 17 00:00:00 2001 From: Timothy Mothra Date: Fri, 21 Feb 2020 14:24:54 -0800 Subject: [PATCH 2/2] bump version (prep 2.14-beta2) (#1704) --- .props/_GlobalStaticVersion.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.props/_GlobalStaticVersion.props b/.props/_GlobalStaticVersion.props index 7b85eb2a0d..ebe6c79bdf 100644 --- a/.props/_GlobalStaticVersion.props +++ b/.props/_GlobalStaticVersion.props @@ -13,7 +13,7 @@ 2 14 0 - beta1 + beta2