diff --git a/tests/Wolfgang.Etl.Abstractions.Tests.Unit/Performance/AllocationFreeTests.cs b/tests/Wolfgang.Etl.Abstractions.Tests.Unit/Performance/AllocationFreeTests.cs index 5e6c0b66..e64a2515 100644 --- a/tests/Wolfgang.Etl.Abstractions.Tests.Unit/Performance/AllocationFreeTests.cs +++ b/tests/Wolfgang.Etl.Abstractions.Tests.Unit/Performance/AllocationFreeTests.cs @@ -1,3 +1,7 @@ +// GC.GetAllocatedBytesForCurrentThread was added to .NET Framework in 4.8, so this +// suite compiles on net48+ / netcoreapp3.1+ / net5.0+ but not net462/net472. The +// allocation behaviour under test is TFM-agnostic, so the modern targets cover it. +#if !NET462 && !NET472 using System; using System.Collections.Generic; using System.Runtime.CompilerServices; @@ -127,3 +131,4 @@ protected override IAsyncEnumerable ExtractWorkerAsync(CancellationToken to protected override Report CreateProgressReport() => new(CurrentItemCount); } } +#endif