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

[.NET Fx] Fix redirections for System.Diagnostics.DiagnosticSource 4.x #3148

Closed
Kielek opened this issue Nov 21, 2023 · 1 comment
Closed
Milestone

Comments

@Kielek
Copy link
Contributor

Kielek commented Nov 21, 2023

Azure.Storage.Blobs 12.17.0 and lowers together with dependencies is compiled against System.Diagnostics.DiagnosticSource 4.6.0.
It was changed in 12.18.0 by Azure/azure-sdk-for-net#37418 and bumped to 6.0.1.

Lets consider TestApplication.Azure for 2.17.0 executed on .NET Fx 4.6.2

for our release v1.1.0 without changes

<PackageReference Include="Azure.Storage.Blobs" VersionOverride="$(LibraryVersion)" />  <!-- 12.17.0 compiled against S.D.DS 4.6.0 -->
<PackageReference Include="System.Diagnostics.DiagnosticSource" /> <!-- 7.0.2 -->

In runtime it will load only System.Diagnostics.DiagnosticSource 7.0.2 from local application folder.

For our release v1.1.0 with removed reference to System.Diagnostics.DiagnosticSource

<PackageReference Include="Azure.Storage.Blobs" VersionOverride="$(LibraryVersion)" />  <!-- 12.17.0 compiled against S.D.DS 4.6.0 -->

In runtime it will load System.Diagnostics.DiagnosticSource 7.0.2 from tracer-home folder and 4.x from local application folder.

Lets consider code from this branch, commit: 3d36fed (before Azure test fix)

<PackageReference Include="Azure.Storage.Blobs" VersionOverride="$(LibraryVersion)" />  <!-- 12.17.0 compiled against S.D.DS 4.6.0 -->
<PackageReference Include="System.Diagnostics.DiagnosticSource" /> <!-- 7.0.2 -->

In runtime it will load System.Diagnostics.DiagnosticSource 8.0.0 from tracer-home folder and 7.0.2 from local application folder.

Test azure commit fix: 6a43c05

<PackageReference Include="Azure.Storage.Blobs" VersionOverride="$(LibraryVersion)" />  <!-- 12.17.0 compiled against S.D.DS 4.6.0 -->
<PackageReference Include="System.Diagnostics.DiagnosticSource" Condition=" '$(TargetFramework)' == 'net6.0' " /> <!-- N/A -->
<PackageReference Include="System.Diagnostics.DiagnosticSource" VersionOverride="8.0.0" Condition=" '$(TargetFramework)' == 'net462' and '$(LibraryVersion)' != '' and '$(LibraryVersion)'&lt;'12.18.0' " /> <!-- 8.0.0 -->

In runtime it will load System.Diagnostics.DiagnosticSource 8.0.0 from local application folder.
If we fully remove reference to System.Diagnostics.DiagnosticSource it will work similar to v1.1.0 release. In runtime it will load System.Diagnostics.DiagnosticSource 8.0.0 from tracer-home folder and 4.x from local application folder.

2 versions of the System.Diagnostics.DiagnosticSource are loaded to the same, main, app domain. It leads to the scenario where spans/activities are not registered by OpenTelemetry SDK.

'Azure.Storage.Blobs' 12.18.0+ with dependencies is compiled againsts System.Diagnostics.DiagnosticSource 6.0.1. Redirections seems to be working fine for this version. All expected spans are recorder.

Proposal:

  • Release with fixes from 6a43c05 (test) and e1bafca (documentation)
  • Based on the findings solves the issue with riderecting old System.Diagnostics.DiagnosticSource 4.x to the modern one.
@Kielek Kielek changed the title Azure.Storage.Blobs 12.17.0 and lowers together with dependencies is compiled against System.Diagnostics.DiagnosticSource 4.6.0. [.NET Fx] Fix redirections for System.Diagnostics.DiagnosticSource 4.x Nov 21, 2023
@Kielek Kielek mentioned this issue Nov 21, 2023
5 tasks
@pjanotti pjanotti added this to the 1.3.0 milestone Dec 13, 2023
@Kielek Kielek modified the milestones: 1.3.0, vNext Jan 17, 2024
@nrcventura
Copy link
Member

Close per SIG discussion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants