3

I am new to Python. I developed a C# library .Net Standard 2.0 and i tried to load this in Python using import clr by installing python .net package. The problem is that if I change the version of .net to 1.4 or lower then it works otherwise it show ModuleNotFound Error. Does anyone have idea of dealing with this problem? I don't want to change the version of my .net standard.

import clr
import sys
assemblydir = r"C:\\Python"
assemblypath = r"C:\\Python\Mylib.dll"
sys.path.append(assemblydir)
clr.FindAssembly(assemblypath)
clr.AddReference("Mylib")
from Mylib import Animal
a = Animal()
print (a.Get())

1 Answer 1

4

According to the changelog here, NetStandard 2.0 support is added on the unreleased versions. So you are probably using PythonNet 2.3.0 or lower. Try getting Pythonnet 2.4.0 from appveyor. Follow the instructions on the installation wiki.

Sign up to request clarification or add additional context in comments.

11 Comments

ci.appveyor.com/project/pythonnet/pythonnet/branch/master . from this link I can't get anything
Jobs are in progress (Queued) you should wait until its finished depending on the python version you want. When its done clic on your version and go to "Artifacts".
ok...do you know .. how long will it take..I mean do I have to wait for days? :)
What version of Python do you need ?
Python version 3.6.5
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.