System.Diagnostics.DiagnosticSource version conflict between Revit and Azure.Identity / MSAL

System.Diagnostics.DiagnosticSource version conflict between Revit and Azure.Identity / MSAL

andrea.tassera
Contributor Contributor
474 Views
1 Reply
Message 1 of 2

System.Diagnostics.DiagnosticSource version conflict between Revit and Azure.Identity / MSAL

andrea.tassera
Contributor
Contributor

Hi all,

We ran into a nasty dependency conflict and wanted to share our findings in case others are hitting the same wall.

 

Revit (up to and including 2026) bundles System.Diagnostics.DiagnosticSource v4.0.1. Recent versions of Microsoft.Identity.Client (4.58+) require v6.0+, because v6.0 introduced a new Meter class that MSAL now depends on.

 

The chain of dependencies is:

  • Azure.Identity → depends on Microsoft.Identity.Client
  • Microsoft.Identity.Client 4.58+ → requires System.Diagnostics.DiagnosticSource 6.0+
  • Revit ships with System.Diagnostics.DiagnosticSource 4.0.1 → no Meter class → kaboom💥

The (ugly) workaround

We found that Microsoft.Identity.Client 4.57.0 is the last version that doesn't pull in DiagnosticSource 6.0+, and Azure.Identity 1.10.4 is the last version that ships with MSAL ≤ 4.57.

Pinning to those versions fixes the crash — but both are marked as Vulnerable and Deprecated on NuGet, which is obviously not something we want to ship with long-term.

 

So we're wondering;

  • Has anyone found a cleaner workaround, e.g. assembly binding redirects or any other load-order trick that actually works in the Revit context?
  • Has anyone heard from Autodesk on updating their bundled DiagnosticSource version?

We're curious whether this is already on their radar or if others have found a path forward. Any input appreciated!

0 Likes
475 Views
1 Reply
Reply (1)
Message 2 of 2

peter_hirn
Enthusiast
Enthusiast

Hi,

 

did you try to merge your dlls using https://github.com/gluck/il-repack ?

 

I recently ran into this conflict with OpenTelemetry .NET, but eventually gave up and switched to a different solution.

0 Likes