- Notifications
You must be signed in to change notification settings - Fork748
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
I'm trying to use pythonnet.3.0.1 to load/use a DLL in Python code that is compiled to require a .NET 4.8 (Target Framework: 4.8). Loading DLL doesn't work (ModuleNotFoundError: No module named 'DllThatRequires4.8'). I'm able to load a DDL from the same path that doesn't require .NET 4.8 (Target Framework: 4.0). I suspect my issue is that pythonnet doesn't target the 4.8 runtime (see undefined runtime version in code output), how can I configure it to do so? I've found some examples of loading a .NET core with config:https://learn.microsoft.com/en-us/dotnet/core/runtime-config/#runtimeconfigjson, but nothing on legacy .NET. My Windows Server 2016 machine has a .NET 4.8 installed, as shown under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full\Version: 4.8.03761 My code (simplified): .... |
BetaWas this translation helpful?Give feedback.
All reactions
Replies: 1 comment 4 replies
-
The runtime version is just not implemented (yet) for .NET Framework. If .NET 4.8 is installed, it should be used (I think :)). You could try to modify |
BetaWas this translation helpful?Give feedback.
All reactions
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
Curious thing though, the setup described above is an attempt to upgrade the test environment running on Python 3.7.9/pythonnet 2.4.0 for a good while. This outdated setup works with 4.8 DLLs as expected, and I tried to jump versions directly to Python 3.10.8 32-bit/ pythonnet 3.0.1. |
BetaWas this translation helpful?Give feedback.
All reactions
-
Hmm, I don't think there were any significant changes between 2.4 and 2.5, just cleanups and additional code, seev2.4.0...v2.5.0. In particular, none of the changes touch the target frameworks, as far as I can tell. Can you try to create a minimal DLL that exhibits the behaviour? |
BetaWas this translation helpful?Give feedback.
All reactions
-
Sorry for delay in replying. I, along with some colleagues, were trying to find the root cause, but no joy so far. |
BetaWas this translation helpful?Give feedback.
All reactions
-
Sorry for my interruption, but I assume I also faced same issue. In my case I prepared wrapper C# DLL to be called from Pythonnet as workaround. I understand this is not best way but I hope this help. |
BetaWas this translation helpful?Give feedback.