Skip to content

Initialize() crash from .NET Framework application #2205

Description

@anovik

Environment

  • Pythonnet version: 3.0.1
  • Python version: 3.10
  • Operating System: windows 11/10
  • .NET Runtime: NET Framework 4.6.1

Details

I am trying to call Python code from .NET Framework app but on some machines PythonEngine.Initialize() crashes.

Runtime.PythonDLL = "C:\\Python\\Python310\\python310.dll";
PythonEngine.Initialize();

Exception:

System.TypeInitializationException: 'The type initializer for 'Delegates' threw an exception.'

There are two inner exceptions:

DllNotFoundException: Could not load C:\Python\Python310\python310.dll.
Win32Exception: %1 is not a valid Win32 application

The path is correct and the dll exists.

image

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions