Skip to content

Commit 460a2df

Browse files
committed
trying to add compatible DiagnosticSource version for framework
1 parent a815edd commit 460a2df

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tracer/test/test-applications/integrations/Samples.Quartz/Samples.Quartz.csproj

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,16 @@
99
<Nullable>enable</Nullable>
1010
<ImplicitUsings>enable</ImplicitUsings>
1111
<GenerateTargetFrameworkAttribute>false</GenerateTargetFrameworkAttribute>
12+
<!-- Multi-target to support both .NET Framework and .NET Core scenarios -->
13+
<TargetFrameworks Condition="'$(OS)' == 'Windows_NT'">net48;netcoreapp3.0;netcoreapp3.1;net5.0;net6.0;net7.0;net8.0;net9.0;net10.0</TargetFrameworks>
14+
<TargetFrameworks Condition="'$(OS)' != 'Windows_NT'">netcoreapp3.0;netcoreapp3.1;net5.0;net6.0;net7.0;net8.0;net9.0;net10.0</TargetFrameworks>
1215
</PropertyGroup>
1316

1417
<ItemGroup>
1518
<PackageReference Include="Quartz" Version="$(ApiVersion)" />
16-
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="8.0.0" />
19+
<!-- Use older DiagnosticSource for .NET Framework and .NET Core 3.x to match what's available in the runtime -->
20+
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="4.4.1" Condition="'$(TargetFramework)' == 'net48' OR '$(TargetFramework)' == 'netcoreapp3.0' OR '$(TargetFramework)' == 'netcoreapp3.1'" />
21+
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="8.0.0" Condition="'$(TargetFramework)' != 'net48' AND '$(TargetFramework)' != 'netcoreapp3.0' AND '$(TargetFramework)' != 'netcoreapp3.1'" />
1722
<!-- Uncomment the packages below to use OTEL instrumentation -->
1823
<!-- <PackageReference Include="OpenTelemetry.Exporter.Console" Version="1.12.0" /> -->
1924
<!-- <PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.12.0" /> -->

0 commit comments

Comments
 (0)