← Winnitude! Search  ·  Reader Mode (1252 ms)
Links: Stay in Reader Retro Site Converter Retro Mode: OFF Original Page ↗
GITHUB · 6 LINKS

Better error handling when DLL cannot be loaded due to missing reference · Issue #2566 · pythonnet/pythonnet

Repository navigation

Better error handling when DLL cannot be loaded due to missing reference  #2566


New issue

New issue

Open

Open
Better error handling when DLL cannot be loaded due to missing reference #2566

Description

@zarif98's profile zarif98 opened on Mar 19, 2025

We recently added a couple of new references to our DLL which caused one of our DLLs to stop loading. We were really confused as to why since nothing has really changed other than the references. And we have generally not had to add reference previously either.

And this ModuleNotFoundError is really vague as to why it's failing. I would also say it's misguiding the user on what the actual issue which is the lack of references to a missing module that it has no access to and needs to be added.

Let's say I have a .csproj DLL that I'm referencing called HelloWorld.csproj and has references reference1 and reference2.

Since I didn't add a reference to import reference1.dll and reference2.dll it is failing to load my HelloWorld.csproj giving me a ModuleNotFoundError.

I think the best thing to do in this scenario is to highlight the fact that the DLL is unable to be loaded because of the missing modules since if we manually add the references the issue is fixed like clr.addReference(reference1) and clr.addReference(reference2).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions