Pythonnet 无法加载 System.IO.Path (.net 6.0)



我使用Python 3.10和。Net 6.0。我的c#代码调用目录。从System.IO.

获取GetFiles函数当我使用Pythonnet从python调用dll时,它显示无法加载类型:System.IO.Path.

请提供一些说明。谢谢。

from clr_loader import get_coreclr
from pythonnet import set_runtime
rt = get_coreclr(runtime_config = r"D:runtimeConfig.json")
set_runtime(rt)

和json文件:

{
"runtimeOptions": {
"tfm": "net6.0",
"framework": {
"name": "Microsoft.NETCore.App",
"version": "6.0.0"
}
}
}

相关内容