I wrote the simplest DLL using C# and copied it to the desktop. Now I wanted to load the DLL in order to see that I can use the API but I get some errors:
the code I used: (edited after looking at some questions here)
import clr
import sys
sys.path.Add("C:\Desktop\DLLTest.dll")
clr.AddReference("C:\Desktop\DLLTest.dll")
I get this error :
Traceback (most recent call last):
File "<string>", line 1, in <module>
IOError: System.IO.IOException: Could not add reference to assembly DLLTest.dll
what is needed to be added to sys path? why? thanks!!!
User clr.AddReferenceToFileAndPath
and double your backslashes. So:
import clr
clr.AddReferenceToFileAndPath('C:\\Desktop\\DLLTest.dll')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With