You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Cannot load "System.Windows.Forms" when run demo\helloform.py if set PYTHONNET_RUNTIME=coreclr #2010
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
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
Activity