我正在试用Fedora29,使用Mono5.18、Python3.7和NetCore3.0.100-Preview-009812,
如果使用绝对路径解析netcore dll
import clr
import os
clr.AddReference(os.path.abspath('./bin/Debug/netstandard2.0/sample.dll'))
import sample
p = sample.Person(name='Peter')
netcore项目就是这样产生的
dotnet new classlib -o sample
个人类别
using System;
namespace sample
{
public class Person
{
public string Name { get; set; }
}
}
更新
基于@smhp提供的数据,main.net framework/mono(pythonnet runtime)和以.netcoreapp 2.0为目标的库之间似乎不兼容。