diff --git a/src/runtime/runtime.cs b/src/runtime/runtime.cs index a8d861770..b779c6707 100644 --- a/src/runtime/runtime.cs +++ b/src/runtime/runtime.cs @@ -2518,7 +2518,19 @@ static Delegates() } static global::System.IntPtr GetFunctionByName(string functionName, global::System.IntPtr libraryHandle) - => libraryLoader.GetFunction(libraryHandle, functionName); + { + try + { + return libraryLoader.GetFunction(libraryHandle, functionName); + } + catch (MissingMethodException e) when (libraryHandle == IntPtr.Zero) + { + throw new MissingMethodException( + "Did you forget to set Runtime.PythonDLL?" + + " See https://github.com/pythonnet/pythonnet#embedding-python-in-net", + e); + } + } internal static delegate* unmanaged[Cdecl] PyDictProxy_New { get; } internal static delegate* unmanaged[Cdecl] Py_IncRef { get; } pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy