Skip to content

[Proposal] Provide a "logical stacktrace" when assemblies fail to load. #9185

Closed

Description

@masonwheeler

We've all had it happen. We go to load a program, or load an assembly into our program, and it fails with an "assembly not found" error on some assembly we didn't ask for, that doesn't look at first glance like it has anything to do with what we're trying to load. Generally it's a dependency of a dependency of a dependency of a dependency of what we actually care about, and the actual problem to be fixed could lie at any point along that dependency chain.

Knowing what this chain is is the information that we need to resolve the issue, but it's not provided, which makes fixing these problems like pulling teeth sometimes.

It would be great if we could get a "stacktrace" of the dependency chain, so that instead of simply saying:

Could not load file or assembly 'Foo, Version=0.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the file specified.

it would then continue on and say:

while loading assembly Bar, Version=0.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51
while loading assembly Baz, Version=0.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51
while loading assembly Qux, Version=0.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51

How much work would it be to fix this up?

Activity

  1. transferred this issue fromdotnet/coreclron Jan 31, 2020
  2. added this to the Future milestone on Jan 31, 2020
  3. MagicAndre1981 commented on Nov 4, 2021

    @MagicAndre1981

    you can already use ETW to capture fusion loading events and view them in Perfview

    image

  4. added a commit that references this issue on Mar 19, 2026
    f602c5c
  5. added
    in-pr
    on Mar 19, 2026
  6. dotnet-policy-service commented on Apr 15, 2026

    @dotnet-policy-service
    Contributor

    Tagging subscribers to this area: @agocke, @elinor-fung
    See info in area-owners.md if you want to be subscribed.

  7. MagicAndre1981 commented on May 4, 2026

    @MagicAndre1981

    #125795 was merged into main. Will this go into 11 P5?

  8. elinor-fung commented on May 13, 2026

    @elinor-fung
    Member

    Yes, it should make .NET 11 preview 5.

  9. locked and limited conversation to collaborators on Jun 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-AssemblyLoaderin-pr

    Type

    No type

    Projects

    • Status
      No status

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions