clr.AddReference fails on macOS and Linux with .NET 9 but works on Windows #2515
Replies: 3 comments 1 reply
-
|
I managed to resolve the issue by adding the directory containing my assembly (pythonnet_minimal.dll) to sys.path before importing clr. For some reasons, it was working with .Nnet8 and stopped working with .Net9. https://github.com/aesim-tech/pythonnet_minimal was updated accordingly. |
Beta Was this translation helpful? Give feedback.
-
|
Is there any update on this? I have same problem. |
Beta Was this translation helpful? Give feedback.
-
|
Yeah I got the same problem. Adding the path does not help. Started after update from net8 to net10 (with net9 added to the system) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Environment
Details
It seems that there is a compatibility issue with .NET 9 on macOS and Linux. Calling 'clr.AddReference(path)' fails on these platforms but works on Windows when the library is compiled with .NET 9 and the .NET runtime version is set to “9.0.0”.
I have created a simple repo that reproduces this issue: https://github.com/aesim-tech/pythonnet_minimal. You can check the action that runs on Windows and fails on Linux.
Note: The same code works correctly on macOS and Linux when targeting .NET 8.0.
Steps to Reproduce
git clone https://github.com/aesim-tech/pythonnet_minimal.gitdotnet buildpython pythonnet_minimal.pyBeta Was this translation helpful? Give feedback.
All reactions