question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't load .NET 5.0 assemblies (ModuleNotFoundError)

See original GitHub issue

Environment

  • Pythonnet version: 2.5.2
  • Python version: 3.8.9
  • Operating System: Windows 10
  • .NET Runtime: .NET 5.0

Details

  • Describe what you were trying to get done.

    I’m trying to import a .NET 5.0 library into my Python project. It fails with ModuleNotFoundError error.

  • What commands did you run to trigger this issue? If you can provide a Here is my C# Code:

using System;

namespace MyNameSpace
{
    public class Test
    {
        public String PrintTest()
        {
            return "TEST";
        }
    }
}

Here is my Python code:

import clr

clr.AddReference("neo-wrapper-library")
from MyNameSpace import Test

test = Test()
print(test.PrintTest())

It works fine if the class is packaged on a .NET Standard library. It fails with ModuleNotFoundError: No module named 'MyNameSpace' if packaged on a .NET 5 library application

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
lostmsucommented, Aug 31, 2021

You can always install from master

1reaction
lostmsucommented, Aug 31, 2021

It is supported in v3 previews.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Where did all the assemblies go ? .NET 5.0 error CS1069
The package gets installed under your user account's home directory, not in a system-wide folder requiring elevated user permissions to access ...
Read more >
Cannot Load a .NET 5.0 Assembly on Build · Issue #6645
Describe the problem and the steps to reproduce it. I am building multi-target MSI assemblies. The build works find when targeting net472 ...
Read more >
Troubleshoot .NET Framework targeting errors
To resolve the error, make sure that your application targets a .NET version that's compatible with the version that's targeted by the projects ......
Read more >
NETSDK1045: The current .NET SDK does not support ...
This error occurs when the build tools can't find the version of the .NET SDK that's needed to build a project. This is...
Read more >
Error Loading .NET Assemblies in LabVIEW - NI - Support
When I try to load a .NET assembly using the Constructor Node VI in LabVIEW, I receive one of the following error messages:...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found