From 83f9e49c410c459730daaa3043e2e55e49d029f1 Mon Sep 17 00:00:00 2001 From: Timothy Mothra Date: Wed, 5 May 2021 17:21:13 -0700 Subject: [PATCH] remove net452 and net46 from aspnetcore (#2252) * remove net452 and net46 from aspnetcore * changelog * consolidate package references --- CHANGELOG.md | 1 + .../ApplicationInsightsLogger.cs | 2 +- ...soft.ApplicationInsights.AspNetCore.csproj | 27 ++++--------------- .../SdkVersionUtils.cs | 2 +- ...ainNameRoleInstanceTelemetryInitializer.cs | 2 +- ...pplicationInsights.AspNetCore.Tests.csproj | 2 +- 6 files changed, 10 insertions(+), 26 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2ee70bd608..b9040f6985 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - [Fix PropertyFetcher error when used with multiple types](https://github.com/microsoft/ApplicationInsights-dotnet/issues/2194) - [New Task Based Flush API - FlushAsync](https://github.com/microsoft/ApplicationInsights-dotnet/issues/1743) +- [End support for net45 and net46 in AspNetCore](https://github.com/microsoft/ApplicationInsights-dotnet/pull/2252) ## Version 2.17.0 - [Fix: telemetry parent id when using W3C activity format in TelemetryDiagnosticSourceListener](https://github.com/microsoft/ApplicationInsights-dotnet/issues/2142) diff --git a/NETCORE/src/Microsoft.ApplicationInsights.AspNetCore/Logging/Implementation/ApplicationInsightsLogger.cs b/NETCORE/src/Microsoft.ApplicationInsights.AspNetCore/Logging/Implementation/ApplicationInsightsLogger.cs index e20a1fc27d..5a19c55aa0 100644 --- a/NETCORE/src/Microsoft.ApplicationInsights.AspNetCore/Logging/Implementation/ApplicationInsightsLogger.cs +++ b/NETCORE/src/Microsoft.ApplicationInsights.AspNetCore/Logging/Implementation/ApplicationInsightsLogger.cs @@ -19,7 +19,7 @@ [SuppressMessage("Documentation Rules", "SA1614:ElementParameterDocumentationMustHaveText", Justification = "This class is obsolete and will not be completely documented.")] internal class ApplicationInsightsLogger : ILogger { -#if NET452 || NET46 || NET461 +#if NET461 /// /// SDK Version Prefix. /// diff --git a/NETCORE/src/Microsoft.ApplicationInsights.AspNetCore/Microsoft.ApplicationInsights.AspNetCore.csproj b/NETCORE/src/Microsoft.ApplicationInsights.AspNetCore/Microsoft.ApplicationInsights.AspNetCore.csproj index 0213611607..f4b58fff9a 100644 --- a/NETCORE/src/Microsoft.ApplicationInsights.AspNetCore/Microsoft.ApplicationInsights.AspNetCore.csproj +++ b/NETCORE/src/Microsoft.ApplicationInsights.AspNetCore/Microsoft.ApplicationInsights.AspNetCore.csproj @@ -3,7 +3,7 @@ Microsoft.ApplicationInsights.AspNetCore - netstandard2.0;net452;net46;net461 + netstandard2.0;net461 netstandard2.0 $(DefineConstants);AI_ASPNETCORE_WEB; @@ -30,29 +30,12 @@ - - - - - - - - - - - - - - - - - - - - - + + + + diff --git a/NETCORE/src/Microsoft.ApplicationInsights.AspNetCore/SdkVersionUtils.cs b/NETCORE/src/Microsoft.ApplicationInsights.AspNetCore/SdkVersionUtils.cs index 8776e7bfb5..f5e13ed89e 100644 --- a/NETCORE/src/Microsoft.ApplicationInsights.AspNetCore/SdkVersionUtils.cs +++ b/NETCORE/src/Microsoft.ApplicationInsights.AspNetCore/SdkVersionUtils.cs @@ -8,7 +8,7 @@ /// internal class SdkVersionUtils { -#if NET452 || NET46 || NET461 +#if NET461 /// /// SDK Version Prefix. /// diff --git a/NETCORE/src/Shared/TelemetryInitializers/DomainNameRoleInstanceTelemetryInitializer.cs b/NETCORE/src/Shared/TelemetryInitializers/DomainNameRoleInstanceTelemetryInitializer.cs index 91aedb7d7d..ec9fc7eb7a 100644 --- a/NETCORE/src/Shared/TelemetryInitializers/DomainNameRoleInstanceTelemetryInitializer.cs +++ b/NETCORE/src/Shared/TelemetryInitializers/DomainNameRoleInstanceTelemetryInitializer.cs @@ -43,7 +43,7 @@ private string GetMachineName() string hostName = Dns.GetHostName(); // Issue #61: For dnxcore machine name does not have domain name like in full framework -#if NET452 || NET46 || NET461 +#if NET461 string domainName = IPGlobalProperties.GetIPGlobalProperties().DomainName; if (!hostName.EndsWith(domainName, StringComparison.OrdinalIgnoreCase)) { diff --git a/NETCORE/test/Microsoft.ApplicationInsights.AspNetCore.Tests/Microsoft.ApplicationInsights.AspNetCore.Tests.csproj b/NETCORE/test/Microsoft.ApplicationInsights.AspNetCore.Tests/Microsoft.ApplicationInsights.AspNetCore.Tests.csproj index b4bd155765..34f252f64b 100644 --- a/NETCORE/test/Microsoft.ApplicationInsights.AspNetCore.Tests/Microsoft.ApplicationInsights.AspNetCore.Tests.csproj +++ b/NETCORE/test/Microsoft.ApplicationInsights.AspNetCore.Tests/Microsoft.ApplicationInsights.AspNetCore.Tests.csproj @@ -4,7 +4,7 @@ 2.0.0 - netcoreapp2.1;netcoreapp3.1;net46;net461 + netcoreapp2.1;netcoreapp3.1;net461 netcoreapp2.1;netcoreapp3.1 true true