Skip to content

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

@masonwheeler

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-AssemblyLoader-coreclrin-prThere is an active PR which will close this issue when it is merged

    Type

    No type

    Projects

    Status

    No status

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions