1

I am trying to call a C# dll in python. I used these 2 approaches: link1 link2

But i am not able to use this line:

import clr 

clr.AddReference('MyDll') 

from MyNamespace import MyClass

my_instance = MyClass()

But I get an error: in this line:

from MyNamespace import MyClass

cannot import name MyClass

Does anybody now why?

Tim Diekmann
  • 7,755
  • 11
  • 41
  • 69
Loui
  • 11
  • 2
  • Related: https://stackoverflow.com/questions/7367976/calling-a-c-sharp-library-from-python. Can you give us detail on the package used and installed? – Drag and Drop Aug 16 '18 at 11:37
  • I am using Microsoft Visual Studio Express 2017 and JetBrains PyCharm Community Edition 2017.2 x64. Was that your question? – Loui Aug 16 '18 at 15:21

0 Answers0