Skip to content

Commit 546923a

Browse files
committed
Fix CA2263
1 parent 4af041b commit 546923a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/OpenTelemetry.AutoInstrumentation/Instrumentation.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,8 +374,13 @@ private static bool TryInitializeContinuousSamplingExport(
374374
return false;
375375
}
376376

377+
#if NET
378+
var threadSamplesMethod = exportThreadSamplesMethod.CreateDelegate<Action<byte[], int, CancellationToken>>(continuousProfilerExporter);
379+
var allocationSamplesMethod = exportAllocationSamplesMethod.CreateDelegate<Action<byte[], int, CancellationToken>>(continuousProfilerExporter);
380+
#else
377381
var threadSamplesMethod = (Action<byte[], int, CancellationToken>)exportThreadSamplesMethod.CreateDelegate(typeof(Action<byte[], int, CancellationToken>), continuousProfilerExporter);
378382
var allocationSamplesMethod = (Action<byte[], int, CancellationToken>)exportAllocationSamplesMethod.CreateDelegate(typeof(Action<byte[], int, CancellationToken>), continuousProfilerExporter);
383+
#endif
379384

380385
InitializeBufferProcessing(exportInterval, exportTimeout);
381386

0 commit comments

Comments
 (0)