Skip to content

Commit

Permalink
Remove support for obsolete framework versions (#400)
Browse files Browse the repository at this point in the history
* Remove support for obsolete framework versions

- Removes support for .NET 4.5.2 and .NET Core 2.1. The oldest frameworks explicitly targeted are .NET 4.6.2 and .NET Core 3.1
- Enables testing against .NET 6.0
- Updates some dependencies (Application Insights, Newtonsoft JSON, and some system packages)

Fixes issue #399

* Convert HealthReporterBuster project

Adopt SDK style and migrate to .NET 4.7.1

* Use "dotnet build" instead of "msbuild" in scripts

* Use Pegasus directly

* Do not test .NET 5.0 anymore

It will be out of support in early May 2022

* Increase timeout for one of the ETW tests

* Update nuget.exe binary

* Update Elasticsearch version

* Update ApplicationInsights dependency
  • Loading branch information
karolz-ms authored Apr 20, 2022
1 parent 04ea912 commit 4b71137
Show file tree
Hide file tree
Showing 51 changed files with 178 additions and 1,102 deletions.
6 changes: 3 additions & 3 deletions Warsaw.sln
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30804.86
# Visual Studio Version 17
VisualStudioVersion = 17.0.32002.185
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Core", "Core", "{FC86C736-6428-431B-B83F-940BF7182757}"
EndProject
Expand Down Expand Up @@ -53,7 +53,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Diagnostics.Event
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Diagnostics.EventFlow.ServiceFabric", "src\Microsoft.Diagnostics.EventFlow.ServiceFabric\Microsoft.Diagnostics.EventFlow.ServiceFabric.csproj", "{E988D6E6-5DC2-4FED-9AD6-3B2B5EF2BD58}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Diagnostics.EventFlow.FunctionalTests.HealthReporterBuster", "test\Microsoft.Diagnostics.EventFlow.FunctionalTests.HealthReporterBuster\Microsoft.Diagnostics.EventFlow.FunctionalTests.HealthReporterBuster.csproj", "{242D4BE6-4CA8-4288-8843-65DF84BBBD3E}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Diagnostics.EventFlow.FunctionalTests.HealthReporterBuster", "test\Microsoft.Diagnostics.EventFlow.FunctionalTests.HealthReporterBuster\Microsoft.Diagnostics.EventFlow.FunctionalTests.HealthReporterBuster.csproj", "{242D4BE6-4CA8-4288-8843-65DF84BBBD3E}"
ProjectSection(ProjectDependencies) = postProject
{F1EF768D-9E8B-42D5-B0E1-C7EF2270C245} = {F1EF768D-9E8B-42D5-B0E1-C7EF2270C245}
EndProjectSection
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net4.6</TargetFramework>
<TargetFramework>net462</TargetFramework>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
// ------------------------------------------------------------

using System;
#if NET461 || NET471
#if NET462 || NET471
using System.Runtime.InteropServices;
#endif

namespace Microsoft.Diagnostics.EventFlow
{
public static class DateTimePrecise
{
#if NET461 || NET471
#if NET462 || NET471
[DllImport("Kernel32.dll", CallingConvention = CallingConvention.Winapi)]
private static extern void GetSystemTimePreciseAsFileTime(out long filetime);

Expand All @@ -25,7 +25,7 @@ public static DateTime UtcNow
{
get
{
#if NET461 || NET471
#if NET462 || NET471
if (UseSystemTimePrecise)
{
GetSystemTimePreciseAsFileTime(out var filetime);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
using Microsoft.Extensions.Configuration;
using Validation;

#if NET452
#if NET462
using System.Web;
#else
using System.Reflection;
Expand Down Expand Up @@ -534,7 +534,7 @@ private void ProcessLogFileFolder()
}

string basePath;
#if NET452
#if NET462
if (HttpContext.Current != null && HttpContext.Current.Server != null)
{
basePath = HttpContext.Current.Server.MapPath("~/App_Data");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ internal class IPEndpointConverter : JsonConverter
{
public override bool CanConvert(Type objectType)
{
#if NET452 || NETSTANDARD1_6
#if NETSTANDARD1_6
return typeof(EndPoint).GetTypeInfo().IsAssignableFrom(objectType);
#else
return typeof(EndPoint).IsAssignableFrom(objectType);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@

namespace Microsoft.Diagnostics.EventFlow.JsonConverters
{
#if NET461 || NET471 || NETSTANDARD2_0
#if NET462 || NET471 || NETSTANDARD2_0
public class MemberInfoConverter : JsonConverter<MemberInfo>
#else
public class MemberInfoConverter : JsonConverter
#endif
{

#if NET452 || NETSTANDARD1_6
#if NETSTANDARD1_6
public override bool CanConvert(Type objectType)
{
return typeof(MemberInfo).GetTypeInfo().IsAssignableFrom(objectType);
Expand All @@ -33,7 +33,7 @@ public override void WriteJson(JsonWriter writer, object value, JsonSerializer s
}
#endif

#if NET461 || NET471 || NETSTANDARD2_0
#if NET462 || NET471 || NETSTANDARD2_0
public override MemberInfo ReadJson(JsonReader reader, Type objectType, MemberInfo existingValue, bool hasExistingValue, JsonSerializer serializer)
#else
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
Expand All @@ -42,7 +42,7 @@ public override object ReadJson(JsonReader reader, Type objectType, object exist
throw new NotImplementedException();
}

#if NET461 || NET471 || NETSTANDARD2_0
#if NET462 || NET471 || NETSTANDARD2_0
public override void WriteJson(JsonWriter writer, MemberInfo value, JsonSerializer serializer)
#else
public void WriteJson(JsonWriter writer, MemberInfo value, JsonSerializer serializer)
Expand Down

This file was deleted.

Loading

0 comments on commit 4b71137

Please sign in to comment.