Replies: 1 comment
-
I managed to make it work on my side by providing a {
"runtimeOptions": {
"tfm": "net6.0",
"rollForward": "LatestMinor",
"frameworks": [
{
"name": "Microsoft.NETCore.App",
"version": "6.0.0"
},
{
"name": "Microsoft.WindowsDesktop.App",
"version": "6.0.0"
}
]
}
} You need to pass it the file path to the |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Environment
Details
We have some issues when load some asseblies which is built based on .net6 and some depedencies to system** binaries like "System.Drawing.Common".
Tried to add the dependecy path into %PATH%, not working:
Unhandled exception. System.BadImageFormatException: Could not load file or assembly 'System.Drawing.Common, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. Reference assemblies should not be loaded for execution. They can only be loaded in the Reflection-only loader context. (0x80131058)
And found the same issue to run demo\helloform.py if set PYTHONNET_RUNTIME=coreclr
Minimal, Complete, and Verifiable example
this will help us understand the issue.
Traceback (most recent call last):
File "D:\pythonnet-master\demo\helloform.py", line 6, in
clr.AddReference("System.Windows.Forms")
System.IO.FileNotFoundException: Could not load file or assembly 'System.Windows.Forms, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified.
File name: 'System.Windows.Forms, Culture=neutral, PublicKeyToken=null'
at System.Reflection.RuntimeAssembly.InternalLoad(ObjectHandleOnStack assemblyName, ObjectHandleOnStack requestingAssembly, StackCrawlMarkHandle stackMark, Boolean throwOnFileNotFound, ObjectHandleOnStack assemblyLoadContext, ObjectHandleOnStack retAssembly)
at System.Reflection.RuntimeAssembly.InternalLoad(AssemblyName assemblyName, RuntimeAssembly requestingAssembly, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, AssemblyLoadContext assemblyLoadContext)
at System.Reflection.Assembly.Load(AssemblyName assemblyRef)
at Python.Runtime.AssemblyManager.LoadAssembly(AssemblyName name) in /tmp/build-via-sdist-dq4gmg3h/pythonnet-3.0.1/src/runtime/AssemblyManager.cs:line 227
at Python.Runtime.CLRModule.AddReference(String name) in /tmp/build-via-sdist-dq4gmg3h/pythonnet-3.0.1/src/runtime/Types/ClrModule.cs:line 107
Beta Was this translation helpful? Give feedback.
All reactions