Skip to content

Commit 0eeaf50

Browse files
committed
Remove net 6.0 targets and update accordingly
1 parent c5abef6 commit 0eeaf50

File tree

50 files changed

+108
-113
lines changed

Some content is hidden

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

50 files changed

+108
-113
lines changed

.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}"

.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

Directory.Packages.props

+8-8
Original file line numberDiff line numberDiff line change
@@ -111,15 +111,15 @@
111111
<PackageVersion Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.2" />
112112

113113
<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" />
114+
<PackageVersion Include="Microsoft.Extensions.Configuration.UserSecrets" Version="8.0.1" />
115+
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="8.0.1" />
116+
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="8.0.1" />
117+
<PackageVersion Include="Microsoft.Extensions.Hosting.Abstractions" Version="8.0.1" />
118+
<PackageVersion Include="Microsoft.Extensions.Logging" Version="8.0.1" />
119+
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.2" />
120+
<PackageVersion Include="Microsoft.Extensions.Logging.Configuration" Version="8.0.1" />
121121

122-
<PackageVersion Include="Microsoft.NET.Sdk.Functions" Version="4.1.1" />
122+
<PackageVersion Include="Microsoft.NET.Sdk.Functions" Version="4.6.0" />
123123
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
124124
<PackageVersion Include="Microsoft.Owin.Host.SystemWeb" Version="4.1.1" />
125125
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />

build/scripts/Build.fs

+3-5
Original file line numberDiff line numberDiff line change
@@ -236,16 +236,14 @@ module Build =
236236
ToolRestore()
237237
DotNet.Exec ["restore" ; Paths.Solution; "-v"; "q"]
238238
if isWindows then DotNet.Exec ["restore" ; aspNetFullFramework; "-v"; "q"]
239-
240239
let Format () =
241-
DotNet.Exec ["dotnet"; "format"; "--verbosity"; "quiet"; "--exclude"; "src/Elastic.Apm/Libraries/"]
242-
240+
DotNet.Exec ["format"; "--verbosity"; "quiet"; "--verify-no-changes"; "--exclude"; "src/Elastic.Apm/Libraries/"]
243241
let private copyDllsAndPdbs (destination: DirectoryInfo) (source: DirectoryInfo) =
244242
source.GetFiles()
245243
|> Seq.filter (fun file -> file.Extension = ".dll" || file.Extension = ".pdb")
246244
|> Seq.iter (fun file -> file.CopyTo(Path.combine destination.FullName file.Name, true) |> ignore)
247245

248-
/// Creates versioned ElasticApmAgent.zip file
246+
/// Creates versioned ElasticApmAgent.zip file
249247
let AgentZip () =
250248
let name = "ElasticApmAgent"
251249
let currentAssemblyVersion = Versioning.CurrentVersion.FileVersion
@@ -277,7 +275,7 @@ module Build =
277275

278276
// assemblies compiled against 6.0 version of System.Diagnostics.DiagnosticSource
279277
!! (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))
278+
++ (Paths.BuildOutput (sprintf "Elastic.Apm_%i.0.0/net8.0" diagnosticSourceVersion6.Major))
281279
|> Seq.filter Path.isDirectory
282280
|> Seq.map DirectoryInfo
283281
|> Seq.iter (copyDllsAndPdbs (agentDir.CreateSubdirectory(sprintf "%i.0.0" diagnosticSourceVersion6.Major)))

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>

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

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

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

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)

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

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
}

src/Elastic.Apm/Libraries/Newtonsoft.Json/Serialization/JsonSerializerInternalReader.cs

+4-2
Original file line numberDiff line numberDiff line change
@@ -1552,9 +1552,11 @@ private object CreateISerializable(JsonReader reader, JsonISerializableContract
15521552
TraceWriter.Trace(TraceLevel.Info, JsonPosition.FormatMessage(reader as IJsonLineInfo, reader.Path, "Deserializing {0} using ISerializable constructor.".FormatWith(CultureInfo.InvariantCulture, contract.UnderlyingType)), null);
15531553
}
15541554

1555-
SerializationInfo serializationInfo = new SerializationInfo(contract.UnderlyingType, new JsonFormatterConverter(this, contract, member));
1555+
#pragma warning disable SYSLIB0050
1556+
SerializationInfo serializationInfo = new SerializationInfo(contract.UnderlyingType, new JsonFormatterConverter(this, contract, member));
1557+
#pragma warning restore SYSLIB0050
15561558

1557-
bool finished = false;
1559+
bool finished = false;
15581560
do
15591561
{
15601562
switch (reader.TokenType)

src/Elastic.Apm/Libraries/Newtonsoft.Json/Serialization/JsonSerializerInternalWriter.cs

+4-2
Original file line numberDiff line numberDiff line change
@@ -761,10 +761,12 @@ private void SerializeISerializable(JsonWriter writer, ISerializable value, Json
761761

762762
WriteObjectStart(writer, value, contract, member, collectionContract, containerProperty);
763763

764-
SerializationInfo serializationInfo = new SerializationInfo(contract.UnderlyingType, new FormatterConverter());
764+
#pragma warning disable SYSLIB0050
765+
SerializationInfo serializationInfo = new SerializationInfo(contract.UnderlyingType, new FormatterConverter());
765766
value.GetObjectData(serializationInfo, Serializer._context);
767+
#pragma warning restore SYSLIB0050
766768

767-
foreach (SerializationEntry serializationEntry in serializationInfo)
769+
foreach (SerializationEntry serializationEntry in serializationInfo)
768770
{
769771
JsonContract? valueContract = GetContractSafe(serializationEntry.Value);
770772

src/Elastic.Apm/Libraries/Newtonsoft.Json/Utilities/AsyncUtils.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ public static Task<int> ReadAsync(this TextReader reader, char[] buffer, int ind
100100
public static bool IsCompletedSucessfully(this Task task)
101101
{
102102
// IsCompletedSuccessfully is the faster method, but only currently exposed on .NET Core 2.0
103-
#if NET6_0_OR_GREATER
103+
#if NET8_0_OR_GREATER
104104
return task.IsCompletedSuccessfully;
105105
#else
106106
return task.Status == TaskStatus.RanToCompletion;

src/Elastic.Apm/Logging/IApmLoggingExtensions.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ private static LogValuesFormatter GetOrAddFormatter(string message, IReadOnlyCol
7272
return formatter;
7373

7474
formatter = new LogValuesFormatter(message, args);
75-
#if NET6_0_OR_GREATER
75+
#if NET8_0_OR_GREATER
7676
Formatters.AddOrUpdate(message, formatter);
7777
return formatter;
7878
#else

src/Elastic.Apm/Logging/ScopedLogger.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ internal LogValuesFormatter GetOrAddFormatter(string message, IReadOnlyCollectio
3030
return formatter;
3131

3232
formatter = new LogValuesFormatter($"{{{{{{Scope}}}}}} {message}", args, Scope);
33-
#if NET6_0_OR_GREATER
33+
#if NET8_0_OR_GREATER
3434
Formatters.AddOrUpdate(message, formatter);
3535
return formatter;
3636
#else

src/Elastic.Apm/Metrics/Linux/GlobalMemoryStatus.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
using System.Runtime.InteropServices;
99
using Elastic.Apm.Logging;
1010

11-
#if NET6_0_OR_GREATER
11+
#if NET8_0_OR_GREATER
1212
using System.Buffers;
1313
using System.Buffers.Text;
1414
#endif
@@ -19,7 +19,7 @@ internal static class GlobalMemoryStatus
1919
{
2020
public const string ProcMemInfo = "/proc/meminfo";
2121

22-
#if NET6_0_OR_GREATER
22+
#if NET8_0_OR_GREATER
2323
private static readonly FileStreamOptions Options = new() { BufferSize = 0, Mode = FileMode.Open, Access = FileAccess.Read };
2424
private static readonly byte Space = (byte)' ';
2525

@@ -57,7 +57,7 @@ internal static (long totalMemory, long availableMemory) GetTotalAndAvailableSys
5757
}
5858
try
5959
{
60-
#if NET6_0_OR_GREATER
60+
#if NET8_0_OR_GREATER
6161
using var fs = new FileStream(memInfoPath, Options);
6262
var buffer = ArrayPool<byte>.Shared.Rent(8192); // Should easily be large enough for max meminfo file.
6363

src/Elastic.Apm/Metrics/MetricsProvider/CgroupMetricsProvider.cs

+5-5
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
using Elastic.Apm.Helpers;
1313
using Elastic.Apm.Logging;
1414

15-
#if NET6_0_OR_GREATER
15+
#if NET8_0_OR_GREATER
1616
using System.Buffers.Text;
1717
using System.Runtime.CompilerServices;
1818
using System.Text;
@@ -46,7 +46,7 @@ internal class CgroupMetricsProvider : IMetricsProvider
4646
internal static readonly Regex Cgroup2MountPoint = new("^\\d+? \\d+? .+? .+? (.*?) .*cgroup2.*cgroup.*");
4747
internal static readonly Regex MemoryCgroup = new("^\\d+:memory:.*");
4848

49-
#if NET6_0_OR_GREATER
49+
#if NET8_0_OR_GREATER
5050
private static readonly FileStreamOptions Options = new() { BufferSize = 0, Mode = FileMode.Open, Access = FileAccess.Read };
5151
#endif
5252

@@ -316,7 +316,7 @@ private MetricSample GetMemoryMemLimitBytes()
316316
return new MetricSample(SystemProcessCgroupMemoryMemLimitBytes, totalMemory);
317317
}
318318

319-
#if NET6_0_OR_GREATER // Optimised code for newer runtimes
319+
#if NET8_0_OR_GREATER // Optimised code for newer runtimes
320320
return GetLongValueFromFile(_cGroupFiles.MaxMemoryFile, SystemProcessCgroupMemoryMemLimitBytes);
321321
#else
322322
using var reader = new StreamReader(_cGroupFiles.MaxMemoryFile);
@@ -339,7 +339,7 @@ private MetricSample GetMemoryMemUsageBytes()
339339
{
340340
try
341341
{
342-
#if NET6_0_OR_GREATER // Optimised code for newer runtimes
342+
#if NET8_0_OR_GREATER // Optimised code for newer runtimes
343343
return GetLongValueFromFile(_cGroupFiles.UsedMemoryFile, SystemProcessCgroupMemoryMemUsageBytes);
344344
#else
345345
using var reader = new StreamReader(_cGroupFiles.UsedMemoryFile);
@@ -356,7 +356,7 @@ private MetricSample GetMemoryMemUsageBytes()
356356
return null;
357357
}
358358

359-
#if NET6_0_OR_GREATER
359+
#if NET8_0_OR_GREATER
360360
[MethodImpl(MethodImplOptions.AggressiveInlining)]
361361
private MetricSample GetLongValueFromFile(string path, string sampleName)
362362
{

src/Elastic.Apm/OpenTelemetry/ElasticActivityListener.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ private void CreateSpanForActivity(Activity activity, long timestamp, List<SpanL
200200

201201
// By default we set unknown outcome
202202
transaction.Outcome = Outcome.Unknown;
203-
#if NET6_0_OR_GREATER
203+
#if NET8_0_OR_GREATER
204204
switch (activity.Status)
205205
{
206206
case ActivityStatusCode.Unset:
@@ -254,7 +254,7 @@ private static void UpdateSpan(Activity activity, Span span)
254254

255255
// By default we set unknown outcome
256256
span.Outcome = Outcome.Unknown;
257-
#if NET6_0_OR_GREATER
257+
#if NET8_0_OR_GREATER
258258
switch (activity.Status)
259259
{
260260
case ActivityStatusCode.Unset:

src/Elastic.Apm/Report/PayloadSenderV2.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ private void ProcessQueueItems(object[] queueItems)
424424
var message = "Unknown 400 Bad Request";
425425
if (response?.Content != null)
426426
{
427-
#if NET6_0_OR_GREATER
427+
#if NET8_0_OR_GREATER
428428
var intakeResponse = _payloadItemSerializer.Deserialize<IntakeResponse>(response.Content.ReadAsStream());
429429
#else
430430
var intakeResponse = _payloadItemSerializer.Deserialize<IntakeResponse>(response.Content.ReadAsStreamAsync().GetAwaiter().GetResult());

src/azure/Elastic.Apm.Azure.ServiceBus/Elastic.Apm.Azure.ServiceBus.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>netstandard2.0; net6.0</TargetFrameworks>
4+
<TargetFrameworks>netstandard2.0;net8.0</TargetFrameworks>
55
<AssemblyName>Elastic.Apm.Azure.ServiceBus</AssemblyName>
66
<RootNamespace>Elastic.Apm.Azure.ServiceBus</RootNamespace>
77
<PackageId>Elastic.Apm.Azure.ServiceBus</PackageId>

src/instrumentations/Elastic.Apm.EntityFrameworkCore/Elastic.Apm.EntityFrameworkCore.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;net6.0</TargetFrameworks>
3+
<TargetFrameworks>netstandard2.0;net8.0</TargetFrameworks>
44
<RootNamespace>Elastic.Apm.EntityFrameworkCore</RootNamespace>
55
<AssemblyName>Elastic.Apm.EntityFrameworkCore</AssemblyName>
66
<PackageId>Elastic.Apm.EntityFrameworkCore</PackageId>
@@ -11,7 +11,7 @@
1111
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
1212
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" VersionOverride="2.0.0" PrivateAssets="All" />
1313
</ItemGroup>
14-
<ItemGroup Condition=" '$(TargetFramework)' == 'net6.0' ">
14+
<ItemGroup Condition=" '$(TargetFramework)' == 'net8.0' ">
1515
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" PrivateAssets="All" />
1616
</ItemGroup>
1717
<ItemGroup>

src/integrations/Elastic.Apm.AspNetCore/ApplicationBuilderExtensions.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ params IDiagnosticsSubscriber[] subscribers
9393
}
9494

9595
private static string GetEnvironmentName(this IServiceProvider serviceProvider) =>
96-
#if NET6_0_OR_GREATER
96+
#if NET8_0_OR_GREATER
9797
(serviceProvider.GetService(typeof(IWebHostEnvironment)) as IWebHostEnvironment)?.EnvironmentName;
9898
#else
9999
#pragma warning disable CS0246

0 commit comments

Comments
 (0)