Skip to content

Assembly Load Failures #11262

Closed
Closed

Description

@The-Futurist

For years I've wondered why assembly load failures cannot be improved so that the caller can get at the hierarchy of assemblies that were involved when the eventual bad load actually fails.

The unhelpful exception message we've all seen is (for example)

Could not load file or assembly 'Microsoft.Practices.Unity, Version=1.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

It is actually a System.IO.FileNotFoundException but ideally should be a dedicated exception (e.g. AssemblyNotFoundException).

That particular exception could then have a property, a simple list/stack of all of the assemblies in the hierarchy at the time the problem assembly was discovered to be missing. This would be a huge help especially for large systems.

Will the CORE team consider something likes this for .Net Core?

Activity

  1. jkotas commented on Oct 19, 2018

    @jkotas
    Member
  2. vitek-karas commented on Oct 22, 2018

    @vitek-karas
    Member

    We are looking into improving the error messages around assembly loads. I'll add this one to the list.
    We do plan to add the name of the assembly which caused the load to happen (if available).
    I'm wondering if you have a scenario in mind where a full stack of assemblies is needed. Note that the full stack is somewhat tricky as it can be very spread in time (the root is always the app assembly which is loaded first, so it could be quite a while ago).

  3. transferred this issue fromdotnet/coreclron Jan 31, 2020
  4. added this to the Future milestone on Jan 31, 2020
  5. vitek-karas commented on Feb 10, 2021

    @vitek-karas
    Member

    Unfortunately not much progress on exception messages, but there's now detailed tracing for this purpose: https://docs.microsoft.com/en-us/dotnet/core/dependency-loading/collect-details

  6. dotnet-policy-service commented on Aug 13, 2025

    @dotnet-policy-service
    Contributor

    Due to lack of recent activity, this issue has been marked as a candidate for backlog cleanup. It will be closed if no further activity occurs within 14 more days. Any new comment (by anyone, not necessarily the author) will undo this process.

    This process is part of our issue cleanup automation.

  7. added
    backlog-cleanup-candidate
    on Aug 13, 2025
  8. dotnet-policy-service commented on Aug 27, 2025

    @dotnet-policy-service
    Contributor

    This issue will now be closed since it had been marked no-recent-activity but received no further activity in the past 14 days. It is still possible to reopen or comment on the issue, but please note that the issue will be locked if it remains inactive for another 30 days.

  9. removed this from the Future milestone on Aug 27, 2025
  10. locked and limited conversation to collaborators on Sep 26, 2025
  11. removed
    backlog-cleanup-candidate
    on Sep 26, 2025
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-AssemblyLoader-coreclrenhancement

    Type

    No type

    Projects

    • Status
      No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions