Skip to content

Commit efa86c4

Browse files
authored
Remove net 6.0 targets (#2498)
- Removes unsupported net6.0 targets from libraries and updates build and test projects accordingly. - Updates compiler preprocessor directives. - Updates a few critical dependencies to ensure the build and CI processes continue functioning. - Refactors StartupHookTests to ensure all dotnet commands run on 8.0.404 SDK. This can be updated and automated as part of upgrading to the .NET 9 SDK in a future PR. Additional logging is added when debugging test failures locally. Closes #2489
1 parent c5abef6 commit efa86c4

File tree

56 files changed

+534
-430
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+534
-430
lines changed

Diff for: .github/workflows/bootstrap/action.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,13 @@ runs:
4545
uses: actions/setup-dotnet@v4
4646
with:
4747
dotnet-version: |
48-
6.0.x
4948
8.0.x
5049
5150
- id: dotnet
5251
shell: bash
5352
run: |
5453
dotnet --list-sdks
54+
dotnet --version
5555
dotnet tool restore
5656
AGENT_VERSION=$(dotnet minver -t=v -p=canary.0 -v=e)
5757
echo "Version Number: ${AGENT_VERSION}"

Diff for: .github/workflows/install-dependencies/action.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,15 @@
5959
if: "${{ inputs.azure == 'true' && runner.os == 'Linux' }}"
6060
shell: bash
6161
run: |
62-
wget -q https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb
62+
wget -q https://packages.microsoft.com/config/ubuntu/22.04/packages-microsoft-prod.deb
6363
sudo dpkg -i packages-microsoft-prod.deb
6464
sudo apt-get update
65-
sudo apt-get install azure-functions-core-tools-4
65+
sudo apt-get install azure-functions-core-tools-4=4.0.6280-1
6666
6767
- name: 'Windows: Azure functions core tools'
6868
if: "${{ inputs.azure == 'true' && runner.os == 'Windows' }}"
6969
shell: cmd
70-
run: choco install azure-functions-core-tools -y --no-progress -r --version 4.0.4829
70+
run: choco install azure-functions-core-tools -y --no-progress -r --version 4.0.6280
7171

7272
# TEST CONTAINERS CLOUD
7373
# If no PR event or if a PR event that's caused by a non-fork and non dependabot actor

Diff for: .github/workflows/test-linux.yml

+10-2
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,15 @@ jobs:
123123

124124
- name: 'Tests: Integrations'
125125
run: ./build.sh test --test-suite integrations
126-
126+
127+
- name: Store crash dumps
128+
uses: actions/upload-artifact@v4
129+
if: success() || failure()
130+
with:
131+
name: results
132+
retention-days: 1
133+
path: build/output/**/*.dmp
134+
127135
startup-hook-tests:
128136
runs-on: ubuntu-latest
129137
needs: [ 'format', 'tests' ]
@@ -134,7 +142,7 @@ jobs:
134142

135143
- name: 'Tests: StartupHooks'
136144
run: ./build.sh test --test-suite startuphooks
137-
145+
138146
profiler-tests:
139147
runs-on: ubuntu-latest
140148
needs: [ 'format', 'tests' ]

Diff for: .github/workflows/test-windows.yml

+9-3
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,14 @@ jobs:
7171

7272
- name: 'Tests: Integrations'
7373
run: ./build.bat test --test-suite integrations
74+
75+
- name: Store crash dumps
76+
uses: actions/upload-artifact@v4
77+
if: success() || failure()
78+
with:
79+
name: results
80+
retention-days: 1
81+
path: build/output/**/*.dmp
7482

7583
startup-hook-tests:
7684
runs-on: windows-2022
@@ -82,7 +90,7 @@ jobs:
8290

8391
- name: 'Tests: StartupHooks'
8492
run: ./build.bat test --test-suite startuphooks
85-
93+
8694
profiler-tests:
8795
runs-on: windows-2022
8896
needs: [ 'format', 'tests' ]
@@ -114,7 +122,6 @@ jobs:
114122
- name: Add msbuild to PATH
115123
uses: microsoft/setup-msbuild@6fb02220983dee41ce7ae257b6f4d8f9bf5ed4ce # v2
116124

117-
118125
- name: Clean the application
119126
run: msbuild /t:Clean /p:Configuration=Release
120127

@@ -166,7 +173,6 @@ jobs:
166173
--logger:"junit;LogFilePath=%cd%\build\output\junit-{framework}-{assembly}.xml;MethodFormat=Class;FailureBodyFormat=Verbose"
167174
168175
- name: Store test results
169-
if: success() || failure()
170176
uses: actions/upload-artifact@v4
171177
with:
172178
name: test-results-iis

Diff for: Directory.Packages.props

+20-24
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@
22
<PropertyGroup>
33
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
44
</PropertyGroup>
5-
65
<ItemGroup>
76
<GlobalPackageReference Include="MinVer" Version="4.3.0" PrivateAssets="All" />
8-
<GlobalPackageReference Condition="'$(TargetFramework)' == 'net462'" Include="Microsoft.NETFramework.ReferenceAssemblies.net462" Version="1.0.3" PrivateAssets="all"/>
7+
<GlobalPackageReference Condition="'$(TargetFramework)' == 'net462'" Include="Microsoft.NETFramework.ReferenceAssemblies.net462" Version="1.0.3" PrivateAssets="all" />
98
</ItemGroup>
109
<!-- Community Packages -->
1110
<ItemGroup>
@@ -53,15 +52,15 @@
5352
<PackageVersion Include="OpenTelemetry.Extensions.Hosting" Version="1.7.0" />
5453
<PackageVersion Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.8.1" />
5554
<PackageVersion Include="Oracle.ManagedDataAccess" Version="21.13.0" />
56-
<PackageVersion Include="Oracle.ManagedDataAccess.Core" Version="3.21.90"/>
55+
<PackageVersion Include="Oracle.ManagedDataAccess.Core" Version="3.21.90" />
5756
<PackageVersion Include="Polly" Version="7.2.1" />
58-
<PackageVersion Include="Proc" Version="0.6.2"/>
57+
<PackageVersion Include="Proc" Version="0.8.2" />
5958
<PackageVersion Include="RabbitMQ.Client" Version="6.8.1" />
60-
<PackageVersion Include="RichardSzalay.MockHttp" Version="6.0.0"/>
59+
<PackageVersion Include="RichardSzalay.MockHttp" Version="6.0.0" />
6160
<PackageVersion Include="SQLite.CodeFirst" Version="1.5.3.29" />
6261
<PackageVersion Include="SharpZipLib" Version="1.3.3" />
63-
<PackageVersion Include="SpecFlow.Tools.MsBuild.Generation" Version="3.5.5"/>
64-
<PackageVersion Include="SpecFlow.xUnit" Version="3.5.5"/>
62+
<PackageVersion Include="SpecFlow.Tools.MsBuild.Generation" Version="3.5.5" />
63+
<PackageVersion Include="SpecFlow.xUnit" Version="3.5.5" />
6564
<PackageVersion Include="StackExchange.Redis" Version="2.7.20" />
6665
<PackageVersion Include="Swashbuckle.AspNetCore" Version="6.5.0" />
6766
<PackageVersion Include="Testcontainers.Elasticsearch" Version="3.7.0" />
@@ -77,7 +76,6 @@
7776
<PackageVersion Include="xunit" Version="2.7.0" />
7877
<PackageVersion Include="xunit.runner.visualstudio" Version="2.5.7" PrivateAssets="All" IncludeAssets="runtime; build; native; contentfiles; analyzers; buildtransitive" />
7978
</ItemGroup>
80-
8179
<!-- Microsoft/System packages -->
8280
<ItemGroup>
8381
<PackageVersion Include="Microsoft.AspNet.Identity.EntityFramework" Version="2.2.3" />
@@ -98,43 +96,41 @@
9896
<PackageVersion Include="Microsoft.Azure.Cosmos" Version="3.0.0" />
9997
<PackageVersion Include="Microsoft.Azure.DocumentDB.Core" Version="2.22.0" />
10098
<PackageVersion Include="Microsoft.Azure.Functions.Extensions" Version="1.0.0" />
101-
<PackageVersion Include="Microsoft.Azure.Functions.Worker" Version="1.20.0"/>
99+
<PackageVersion Include="Microsoft.Azure.Functions.Worker" Version="1.20.0" />
102100
<PackageVersion Include="Microsoft.Azure.Functions.Worker.Core" Version="1.6.0" />
103-
<PackageVersion Include="Microsoft.Azure.Functions.Worker.Extensions.Http" Version="3.1.0"/>
104-
<PackageVersion Include="Microsoft.Azure.Functions.Worker.Sdk" Version="1.16.1"/>
101+
<PackageVersion Include="Microsoft.Azure.Functions.Worker.Extensions.Http" Version="3.1.0" />
102+
<PackageVersion Include="Microsoft.Azure.Functions.Worker.Sdk" Version="1.16.1" />
105103
<PackageVersion Include="Microsoft.Azure.ServiceBus" Version="3.0.0" />
106104
<PackageVersion Include="Microsoft.Azure.Storage.Blob" Version="11.2.2" />
107105
<PackageVersion Include="Microsoft.Data.SqlClient" Version="5.1.5" />
108106
<PackageVersion Include="Microsoft.EntityFrameworkCore" Version="8.0.2" />
109-
<PackageVersion Include="Microsoft.EntityFrameworkCore.Relational" Version="6.0.0" PrivateAssets="All"/>
107+
<PackageVersion Include="Microsoft.EntityFrameworkCore.Relational" Version="6.0.0" PrivateAssets="All" />
110108
<PackageVersion Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.2" />
111109
<PackageVersion Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.2" />
112-
113110
<PackageVersion Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
114-
<PackageVersion Include="Microsoft.Extensions.Configuration.UserSecrets" Version="8.0.0" />
115-
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
116-
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
117-
<PackageVersion Include="Microsoft.Extensions.Hosting.Abstractions" Version="8.0.0" />
118-
<PackageVersion Include="Microsoft.Extensions.Logging" Version="8.0.0" />
119-
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.0" />
120-
<PackageVersion Include="Microsoft.Extensions.Logging.Configuration" Version="8.0.0" />
121-
122-
<PackageVersion Include="Microsoft.NET.Sdk.Functions" Version="4.1.1" />
111+
<PackageVersion Include="Microsoft.Extensions.Configuration.UserSecrets" Version="8.0.1" />
112+
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="8.0.1" />
113+
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="8.0.1" />
114+
<PackageVersion Include="Microsoft.Extensions.Hosting.Abstractions" Version="8.0.1" />
115+
<PackageVersion Include="Microsoft.Extensions.Logging" Version="8.0.1" />
116+
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.2" />
117+
<PackageVersion Include="Microsoft.Extensions.Logging.Configuration" Version="8.0.1" />
118+
<PackageVersion Include="Microsoft.NET.Sdk.Functions" Version="4.6.0" />
123119
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
124120
<PackageVersion Include="Microsoft.Owin.Host.SystemWeb" Version="4.1.1" />
125121
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
126122
<PackageVersion Include="Microsoft.Web.Administration" Version="11.1.0" />
127123
<PackageVersion Include="MicrosoftAspNetCore.Http" Version="2.1.22" />
128124
<PackageVersion Include="System.CommandLine" Version="2.0.0-beta1.20427.1" />
129125
<PackageVersion Include="System.Data.SQLite" Version="1.0.112" />
130-
<PackageVersion Include="System.Data.SqlClient" Version="4.8.6"/>
126+
<PackageVersion Include="System.Data.SqlClient" Version="4.8.6" />
131127
<PackageVersion Include="System.Diagnostics.DiagnosticSource" Version="5.0.0" />
132128
<PackageVersion Include="System.Diagnostics.PerformanceCounter" Version="6.0.1" />
133129
<PackageVersion Include="System.IO.FileSystem.AccessControl" Version="4.7.0" />
134130
<PackageVersion Include="System.Reflection.Emit" Version="4.3.0" />
135131
<PackageVersion Include="System.Reflection.Emit.Lightweight" Version="4.3.0" />
136132
<PackageVersion Include="System.Reflection.Metadata" Version="5.0.0" />
137-
<PackageVersion Include="System.Runtime.Loader" Version="4.3.0"/>
133+
<PackageVersion Include="System.Runtime.Loader" Version="4.3.0" />
138134
<PackageVersion Include="System.Threading.Tasks.Dataflow" Version="4.9.0" />
139135
<PackageVersion Include="System.Threading.Tasks.Extensions" Version="4.5.4" />
140136
</ItemGroup>

Diff for: ElasticApmAgent.sln

+7-1
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SampleAspNetCoreApp", "test
1818
EndProject
1919
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{267A241E-571F-458F-B04C-B6C4DE79E735}"
2020
ProjectSection(SolutionItems) = preProject
21+
test\.runsettings = test\.runsettings
2122
test\Directory.Build.props = test\Directory.Build.props
2223
test\xunit.runner.json = test\xunit.runner.json
23-
test\.runsettings = test\.runsettings
2424
EndProjectSection
2525
EndProject
2626
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elastic.Apm", "src\Elastic.Apm\Elastic.Apm.csproj", "{90BC9629-C8D2-4FD5-863E-EA2D5FB37341}"
@@ -240,6 +240,12 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HostingTestApp", "test\inte
240240
EndProject
241241
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elastic.Apm.Extensions.Tests.Shared", "test\integrations\Elastic.Apm.Extensions.Tests.Shared\Elastic.Apm.Extensions.Tests.Shared.csproj", "{7482D2D9-BBF7-4C8B-B26C-BEA9BCF345B0}"
242242
EndProject
243+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{7A07D777-DEC2-4BB7-B4A1-028BA658762A}"
244+
ProjectSection(SolutionItems) = preProject
245+
Directory.Build.props = Directory.Build.props
246+
Directory.Packages.props = Directory.Packages.props
247+
EndProjectSection
248+
EndProject
243249
Global
244250
GlobalSection(SolutionConfigurationPlatforms) = preSolution
245251
Debug|Any CPU = Debug|Any CPU

Diff for: build/scripts/Build.fs

+19-7
Original file line numberDiff line numberDiff line change
@@ -173,13 +173,27 @@ module Build =
173173
let testElseWhere = ["Tests"; "OpenTelemetry.Tests"; "StartupHook.Tests"; "Profiler.Managed.Tests"; "Azure"]
174174
let filter = testElseWhere |> List.map (fun s -> $"FullyQualifiedName!~Elastic.Apm.%s{s}") |> String.concat "&"
175175
Some filter
176-
| _ -> None
176+
| _ -> None
177+
178+
let verbosity =
179+
match suite with
180+
| TestSuite.Integrations -> "detailed"
181+
| _ -> "minimal"
182+
183+
let blame =
184+
match suite with
185+
| TestSuite.Integrations -> Some [
186+
"--blame-hang-timeout"; "15m";
187+
"--blame-crash-dump-type"; "mini";
188+
"--results-directory"; "build/output"]
189+
| _ -> None
177190

178191
let command =
179-
["test"; "-c"; "Release"; sln; "--no-build"; "--verbosity"; "minimal"; "-s"; "test/.runsettings"]
192+
["test"; "-c"; "Release"; sln; "--no-build"; "--verbosity"; verbosity; "-s"; "test/.runsettings"]
180193
@ (match filter with None -> [] | Some f -> ["--filter"; f])
181194
@ (match framework with None -> [] | Some f -> ["-f"; f])
182195
@ (match logger with None -> [] | Some l -> [l])
196+
@ (match blame with None -> [] | Some l -> l)
183197
@ ["--"; "RunConfiguration.CollectSourceInformation=true"]
184198

185199
DotNet.ExecWithTimeout command (TimeSpan.FromMinutes 30)
@@ -236,16 +250,14 @@ module Build =
236250
ToolRestore()
237251
DotNet.Exec ["restore" ; Paths.Solution; "-v"; "q"]
238252
if isWindows then DotNet.Exec ["restore" ; aspNetFullFramework; "-v"; "q"]
239-
240253
let Format () =
241-
DotNet.Exec ["dotnet"; "format"; "--verbosity"; "quiet"; "--exclude"; "src/Elastic.Apm/Libraries/"]
242-
254+
DotNet.Exec ["format"; "--verbosity"; "quiet"; "--verify-no-changes"; "--exclude"; "src/Elastic.Apm/Libraries/"]
243255
let private copyDllsAndPdbs (destination: DirectoryInfo) (source: DirectoryInfo) =
244256
source.GetFiles()
245257
|> Seq.filter (fun file -> file.Extension = ".dll" || file.Extension = ".pdb")
246258
|> Seq.iter (fun file -> file.CopyTo(Path.combine destination.FullName file.Name, true) |> ignore)
247259

248-
/// Creates versioned ElasticApmAgent.zip file
260+
/// Creates versioned ElasticApmAgent.zip file
249261
let AgentZip () =
250262
let name = "ElasticApmAgent"
251263
let currentAssemblyVersion = Versioning.CurrentVersion.FileVersion
@@ -277,7 +289,7 @@ module Build =
277289

278290
// assemblies compiled against 6.0 version of System.Diagnostics.DiagnosticSource
279291
!! (Paths.BuildOutput (sprintf "Elastic.Apm.StartupHook.Loader_%i.0.0/netstandard2.0" oldDiagnosticSourceVersion.Major))
280-
++ (Paths.BuildOutput (sprintf "Elastic.Apm_%i.0.0/net6.0" diagnosticSourceVersion6.Major))
292+
++ (Paths.BuildOutput (sprintf "Elastic.Apm_%i.0.0/net8.0" diagnosticSourceVersion6.Major))
281293
|> Seq.filter Path.isDirectory
282294
|> Seq.map DirectoryInfo
283295
|> Seq.iter (copyDllsAndPdbs (agentDir.CreateSubdirectory(sprintf "%i.0.0" diagnosticSourceVersion6.Major)))

Diff for: sample/ApiSamples/Program.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ public static void SampleSpanWithCustomContextFillAll()
314314
// ReSharper restore ArrangeMethodOrOperatorBody
315315
#pragma warning restore IDE0022
316316

317-
#if NET6_0_OR_GREATER
317+
#if NET8_0_OR_GREATER
318318
/// <summary>
319319
/// Test for https://github.com/elastic/apm-agent-dotnet/issues/884
320320
/// </summary>

Diff for: src/Elastic.Apm/Api/Service.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ static bool CheckForLoadedAssembly(string name)
9696
// Legacy mechanism: if the profiler is loaded add a `p` suffix to Agent.Version
9797
service.Agent.Version += "-p";
9898
// Check if profiler was injected via K8S hook.
99-
var envvars =new EnvironmentVariables(logger);
100-
if (envvars.SafeCheckValue("ELASTIC_APM_ACTIVATION_METHOD", "K8S")
99+
var envvars = new EnvironmentVariables(logger);
100+
if (envvars.SafeCheckValue("ELASTIC_APM_ACTIVATION_METHOD", "K8S")
101101
|| envvars.SafeCheckValue("ELASTIC_APM_ACTIVATION_METHOD", "K8S_ATTACH"))
102102
activationMethod = Consts.ActivationK8SAttach;
103103
else

Diff for: src/Elastic.Apm/Elastic.Apm.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFrameworks>netstandard2.0;net462;net472;net6.0</TargetFrameworks>
3+
<TargetFrameworks>netstandard2.0;net462;net472;net8.0</TargetFrameworks>
44
<IsPackable>true</IsPackable>
55
</PropertyGroup>
66
<PropertyGroup>
@@ -103,7 +103,7 @@
103103
<PackageReference Include="System.Threading.Tasks.Dataflow" />
104104
</ItemGroup>
105105

106-
<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
106+
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
107107
<PackageReference Include="System.Diagnostics.PerformanceCounter" />
108108
</ItemGroup>
109109

Diff for: src/Elastic.Apm/Filters/CookieHeaderRedactionFilter.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
using Elastic.Apm.Config;
1010
using Elastic.Apm.Helpers;
1111
using Elastic.Apm.Model;
12-
#if NET6_0_OR_GREATER
12+
#if NET8_0_OR_GREATER
1313
using System.Buffers;
1414
#endif
1515

@@ -45,7 +45,7 @@ internal static void HandleCookieHeader(Dictionary<string, string> headers, IRea
4545
// e.g. Cookies | cookies | COOKIES
4646
const int maxKeys = 4;
4747

48-
#if NET6_0_OR_GREATER
48+
#if NET8_0_OR_GREATER
4949
var matchedKeys = ArrayPool<string>.Shared.Rent(maxKeys);
5050
var matchedValues = ArrayPool<string>.Shared.Rent(maxKeys);
5151
#else
@@ -81,7 +81,7 @@ internal static void HandleCookieHeader(Dictionary<string, string> headers, IRea
8181
}
8282
}
8383

84-
#if NET6_0_OR_GREATER
84+
#if NET8_0_OR_GREATER
8585
ArrayPool<string>.Shared.Return(matchedKeys);
8686
ArrayPool<string>.Shared.Return(matchedValues);
8787
#endif

Diff for: src/Elastic.Apm/Libraries/Newtonsoft.Json/JsonException.cs

+5-3
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,11 @@ public JsonException(string message, Exception? innerException)
7373
/// <exception cref="ArgumentNullException">The <paramref name="info"/> parameter is <c>null</c>.</exception>
7474
/// <exception cref="SerializationException">The class name is <c>null</c> or <see cref="Exception.HResult"/> is zero (0).</exception>
7575
public JsonException(SerializationInfo info, StreamingContext context)
76-
: base(info, context)
77-
{
78-
}
76+
#pragma warning disable SYSLIB0051
77+
: base(info, context)
78+
#pragma warning restore SYSLIB0051
79+
{
80+
}
7981
#endif
8082

8183
internal static JsonException Create(IJsonLineInfo lineInfo, string path, string message)

Diff for: src/Elastic.Apm/Libraries/Newtonsoft.Json/Serialization/JsonFormatterConverter.cs

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#region License
1+
#region License
22

33
// Copyright (c) 2007 James Newton-King
44
//
@@ -35,9 +35,11 @@
3535
#nullable enable
3636
namespace Elastic.Apm.Libraries.Newtonsoft.Json.Serialization
3737
{
38-
internal class JsonFormatterConverter : IFormatterConverter
39-
{
40-
private readonly JsonSerializerInternalReader _reader;
38+
#pragma warning disable SYSLIB0050
39+
internal class JsonFormatterConverter : IFormatterConverter
40+
#pragma warning restore SYSLIB0050
41+
{
42+
private readonly JsonSerializerInternalReader _reader;
4143
private readonly JsonISerializableContract _contract;
4244
private readonly JsonProperty? _member;
4345

Diff for: src/Elastic.Apm/Libraries/Newtonsoft.Json/Serialization/JsonObjectContract.cs

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#region License
1+
#region License
22

33
// Copyright (c) 2007 James Newton-King
44
//
@@ -183,8 +183,10 @@ internal object GetUninitializedObject()
183183
throw new JsonException("Insufficient permissions. Creating an uninitialized '{0}' type requires full trust.".FormatWith(CultureInfo.InvariantCulture, NonNullableUnderlyingType));
184184
}
185185

186-
return FormatterServices.GetUninitializedObject(NonNullableUnderlyingType);
187-
}
186+
#pragma warning disable SYSLIB0050
187+
return FormatterServices.GetUninitializedObject(NonNullableUnderlyingType);
188+
#pragma warning restore SYSLIB0050
189+
}
188190
#endif
189191
}
190192
}

0 commit comments

Comments
 (0)