Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update KubernetesClient DiagnosticSource dependency #1561

Merged
merged 1 commit into from
Jun 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/KubernetesClient/KubernetesClient.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="7.0.0" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so this is net6 only?

we already moved to net8 lol

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, the System.Diagnostics.DiagnosticSource is included in the shared framework, so there's no need to reference this package for most cases.

While we're using the UpDownCounter in the code

private static readonly UpDownCounter<int> ActiveRequests =

The UpDownCounter has been introduced since .NET 7
see the API: https://apisof.net/catalog/c7f52491f5c19b75d271677fe9123886

The shared framework for .NET 6 only has the 6.0.x reference which does not support this UpDownCounter, so we had to add a reference explicitly.

For .NET 7 and later frameworks, we could use the framework reference directly, so no need to add the reference for System.Diagnostics.DiagnosticSource when targeting net8.0 I think

<PackageReference Condition="'$(TargetFramework)'=='net6.0'" Include="System.Diagnostics.DiagnosticSource" Version="7.0.0" />
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="7.1.2" />
<PackageReference Include="IdentityModel.OidcClient" Version="5.2.1" />
<PackageReference Include="Fractions" Version="7.3.0" />
Expand Down
Loading