I'm having issues trying to load a Dll's class made in c# with pythonnet
Here's the dll project config (VS)
Here's the class code
using System;
namespace ClassLibrary1
{
public class Class1{
public void test()
{
Console.WriteLine("Hello from a library");
}
}
}
Here's the dll info
And the script
import clr
clr.AddReference('ClassLibraryAss')
from ClassLibraryAss import Class1
x = Class1()
x.test()
Is able to find the assembly. I follow some examples and it can't be more difficult than this.
This is the output
Traceback (most recent call last):
File ".\testDLL.py", line 23, in <module>
from ClassLibraryAss import Class1
ModuleNotFoundError: No module named 'ClassLibraryAss'
I tried different ways to load the module but with no luck
Environment
- Pythonnet version: 2.5.2 (Also tried 2.5.1)
- Python version: 3.8.0
- Operating System: Windows 10
- Visual studio 2019 (I didn't tried other)