From 748b35109c13077046688ab253c5fde580aa3d34 Mon Sep 17 00:00:00 2001 From: Andrew Stanton-Nurse Date: Tue, 11 Jul 2017 10:30:22 -0700 Subject: [PATCH 1/2] de-exeify HostingStartup to fix downgrade errors --- ...rosoft.AspNetCore.ApplicationInsights.HostingStartup.csproj | 3 +-- ...Microsoft.AspNetCore.AzureAppServices.HostingStartup.csproj | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Microsoft.AspNetCore.ApplicationInsights.HostingStartup/Microsoft.AspNetCore.ApplicationInsights.HostingStartup.csproj b/src/Microsoft.AspNetCore.ApplicationInsights.HostingStartup/Microsoft.AspNetCore.ApplicationInsights.HostingStartup.csproj index 904fedb20f..df5eba9a51 100644 --- a/src/Microsoft.AspNetCore.ApplicationInsights.HostingStartup/Microsoft.AspNetCore.ApplicationInsights.HostingStartup.csproj +++ b/src/Microsoft.AspNetCore.ApplicationInsights.HostingStartup/Microsoft.AspNetCore.ApplicationInsights.HostingStartup.csproj @@ -7,7 +7,6 @@ ASP.NET Core lightup integration with Application Insights. netcoreapp2.0;net461 true - Exe aspnetcore;ApplicationInsights;Analytics;Telemetry;AppInsights @@ -21,4 +20,4 @@ - \ No newline at end of file + diff --git a/src/Microsoft.AspNetCore.AzureAppServices.HostingStartup/Microsoft.AspNetCore.AzureAppServices.HostingStartup.csproj b/src/Microsoft.AspNetCore.AzureAppServices.HostingStartup/Microsoft.AspNetCore.AzureAppServices.HostingStartup.csproj index e59b812222..00fe2799a1 100644 --- a/src/Microsoft.AspNetCore.AzureAppServices.HostingStartup/Microsoft.AspNetCore.AzureAppServices.HostingStartup.csproj +++ b/src/Microsoft.AspNetCore.AzureAppServices.HostingStartup/Microsoft.AspNetCore.AzureAppServices.HostingStartup.csproj @@ -7,7 +7,6 @@ ASP.NET Core lightup integration with Azure AppServices. netcoreapp2.0;net461 true - Exe aspnetcore;azure;appservices @@ -19,4 +18,4 @@ - \ No newline at end of file + From 5ea7030b694606c4ce3cf661143cf72d62abbab2 Mon Sep 17 00:00:00 2001 From: Pavel Krymets Date: Wed, 12 Jul 2017 13:03:19 -0700 Subject: [PATCH 2/2] Reload AI configuration file on change (#76) --- .../ApplicationInsightsStartupLoader.cs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/Microsoft.AspNetCore.ApplicationInsights.HostingStartup/ApplicationInsightsStartupLoader.cs b/src/Microsoft.AspNetCore.ApplicationInsights.HostingStartup/ApplicationInsightsStartupLoader.cs index 746f5f5dc3..68ae6aee96 100644 --- a/src/Microsoft.AspNetCore.ApplicationInsights.HostingStartup/ApplicationInsightsStartupLoader.cs +++ b/src/Microsoft.AspNetCore.ApplicationInsights.HostingStartup/ApplicationInsightsStartupLoader.cs @@ -2,16 +2,12 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; -using System.Collections.Generic; -using System.Diagnostics; using System.IO; -using System.Linq; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Razor.TagHelpers; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; -using Microsoft.Extensions.Options; [assembly: HostingStartup(typeof(Microsoft.AspNetCore.ApplicationInsights.HostingStartup.ApplicationInsightsHostingStartup))] @@ -52,8 +48,9 @@ namespace Microsoft.AspNetCore.ApplicationInsights.HostingStartup if (!string.IsNullOrEmpty(home)) { var settingsFile = Path.Combine(home, "site", "diagnostics", ApplicationInsightsSettingsFile); - var configurationBuilder = new ConfigurationBuilder(); - configurationBuilder.AddJsonFile(settingsFile, optional: true); + var configurationBuilder = new ConfigurationBuilder() + .AddJsonFile(settingsFile, optional: true, reloadOnChange: true); + services.AddLogging(builder => builder.AddConfiguration(configurationBuilder.Build().GetSection("Logging"))); } }