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

[BUG] Exception: Could not load file or assembly 'System.Diagnostics.DiagnosticSource, Version=6.0.0.0 after upgrading Azure.Identity from 1.5.0 to 1.10.2 as per security vulnerability #39632

Closed
aayushsin opened this issue Oct 31, 2023 · 5 comments
Assignees
Labels
Azure.Identity Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-author-feedback Workflow: More information is needed from author to address the issue. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that

Comments

@aayushsin
Copy link

Library name and version

Azure.Identity 1.10.2

Describe the bug

We are facing an exception as detailed below when we tried upgrading Azure.Identity from 1.5.0 to 1.10.2 which is required as per security vulnerability.

Encountered exception: Could not load file or assembly 'System.Diagnostics.DiagnosticSource, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The located assembly's manifest definition does not match the assembly reference. (0x80131040). Retrying after waiting 250000000 ticks. Stack trace:
2023-10-31 09:04:35.095725: at Azure.Core.Pipeline.DiagnosticScopeFactory..ctor(String clientNamespace, String resourceProviderNamespace, Boolean isActivityEnabled, Boolean suppressNestedClientActivities)
2023-10-31 09:04:35.096857: at Azure.Core.Pipeline.ClientDiagnostics..ctor(String optionsNamespace, String providerNamespace, DiagnosticsOptions diagnosticsOptions, Nullable1 suppressNestedClientActivities) 2023-10-31 09:04:35.097762: at Azure.Core.Pipeline.ClientDiagnostics..ctor(ClientOptions options, Nullable1 suppressNestedClientActivities)
2023-10-31 09:04:35.098471: at Azure.Identity.CredentialPipeline..ctor(TokenCredentialOptions options)
2023-10-31 09:04:35.098754: at Azure.Identity.CredentialPipeline.GetInstance(TokenCredentialOptions options)
2023-10-31 09:04:35.100529: at Azure.Identity.ManagedIdentityCredential..ctor(String clientId, TokenCredentialOptions options)

Expected behavior

The issue does not occur with Azure.Identity 1.3.0 or 1.5.0. Is there any breaking change while upgrading?

Actual behavior

The exception as mentioned above.

Reproduction Steps

Upgrade Azure.Idenity from 1.5.0 to 1.10.2

Environment

.netcoreapp3.1

@github-actions github-actions bot added Azure.Identity Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-triage Workflow: This issue needs the team to triage. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Oct 31, 2023
@jsquire jsquire self-assigned this Oct 31, 2023
@jsquire
Copy link
Member

jsquire commented Oct 31, 2023

Hi @aayushsin. Thanks for reaching out and we regret that you're experiencing difficulties. This problem generally occurs when the runtime is unable to load the needed set of dependencies; normally, this is due to a version mismatch due to an application reference that pins an older version either directly or as a transitive dependency. Most often, this can be mitigated by adding an explicit reference to the application that hoists the version. In this case, I'd suggest trying a direct reference to the latest Azure.Core in the application and seeing if that helps.

That said, you seem to be running/targeting netcoreapp3.1, which reached end-of-life in December 2022 and is no longer a supported framework. (src) Unfortunately, we're unable to assist with problems specific to that environment and would need to be able to reproduce in net6 or another supported version to help further.

@jsquire jsquire added needs-author-feedback Workflow: More information is needed from author to address the issue. and removed needs-team-triage Workflow: This issue needs the team to triage. labels Oct 31, 2023
@github-actions
Copy link

Hi @aayushsin. Thank you for opening this issue and giving us the opportunity to assist. To help our team better understand your issue and the details of your scenario please provide a response to the question asked above or the information requested above. This will help us more accurately address your issue.

@Jiadosi
Copy link

Jiadosi commented Nov 4, 2023

Hi @jsquire , I am facing the same exception. I added a direct package reference to the latest Azure.Core 1.35.0 but still no help.

Could not load file or assembly 'System.Diagnostics.DiagnosticSource, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the file specified.
at Azure.Core.Pipeline.DiagnosticScopeFactory..ctor(String clientNamespace, String resourceProviderNamespace, Boolean isActivityEnabled, Boolean suppressNestedClientActivities)
at Azure.Core.Pipeline.ClientDiagnostics..ctor(String optionsNamespace, String providerNamespace, DiagnosticsOptions diagnosticsOptions, Nullable1 suppressNestedClientActivities) at Azure.Core.Pipeline.ClientDiagnostics..ctor(ClientOptions options, Nullable1 suppressNestedClientActivities)
at Azure.Identity.CredentialPipeline..ctor(TokenCredentialOptions options)
at Azure.Identity.CredentialPipeline.<>c.<.cctor>b__16_0()
at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode)

@avendel
Copy link

avendel commented Nov 7, 2023

For netstandard2.0, it looks like the Azure.Core nuspec specifies a dependency on System.Diagnostic.DiagnosticSource 6.0.1, but the assembly manifest indicates that the build dependency is for 6.0.0.

@m-redding
Copy link
Member

This is the same as #39798 - @Jiadosi & @aayushsin I'm going to close this issue and put updates on my investigation in the other thread.

@github-project-automation github-project-automation bot moved this from Untriaged to Done in Azure Identity SDK Improvements Nov 8, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Feb 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Azure.Identity Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-author-feedback Workflow: More information is needed from author to address the issue. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Projects
Development

No branches or pull requests

5 participants