@@ -332,7 +332,7 @@ static void RunAssemblyAndUnload(string domainName)
332332 // assembly (and Python .NET) to reside
333333 var theProxy = CreateInstanceInstanceAndUnwrap < Proxy > ( domain ) ;
334334
335- theProxy . Call ( " InitPython" , ShutdownMode . Soft ) ;
335+ theProxy . Call ( nameof ( PythonRunner . InitPython ) , ShutdownMode . Soft , PyRuntime . PythonDLL ) ;
336336 // From now on use the Proxy to call into the new assembly
337337 theProxy . RunPython ( ) ;
338338
@@ -400,7 +400,7 @@ static void RunDomainReloadSteps<T1, T2>() where T1 : CrossCaller where T2 : Cro
400400 try
401401 {
402402 var theProxy = CreateInstanceInstanceAndUnwrap < Proxy > ( domain ) ;
403- theProxy . Call ( " InitPython" , ShutdownMode . Reload ) ;
403+ theProxy . Call ( nameof ( PythonRunner . InitPython ) , ShutdownMode . Reload , PyRuntime . PythonDLL ) ;
404404
405405 var caller = CreateInstanceInstanceAndUnwrap < T1 > ( domain ) ;
406406 arg = caller . Execute ( arg ) ;
@@ -418,7 +418,7 @@ static void RunDomainReloadSteps<T1, T2>() where T1 : CrossCaller where T2 : Cro
418418 try
419419 {
420420 var theProxy = CreateInstanceInstanceAndUnwrap < Proxy > ( domain ) ;
421- theProxy . Call ( " InitPython" , ShutdownMode . Reload ) ;
421+ theProxy . Call ( nameof ( PythonRunner . InitPython ) , ShutdownMode . Reload , PyRuntime . PythonDLL ) ;
422422
423423 var caller = CreateInstanceInstanceAndUnwrap < T2 > ( domain ) ;
424424 caller . Execute ( arg ) ;
@@ -478,8 +478,9 @@ public static void RunPython()
478478
479479 private static IntPtr _state ;
480480
481- public static void InitPython ( ShutdownMode mode )
481+ public static void InitPython ( ShutdownMode mode , string dllName )
482482 {
483+ PyRuntime . PythonDLL = dllName ;
483484 PythonEngine . Initialize ( mode : mode ) ;
484485 _state = PythonEngine . BeginAllowThreads ( ) ;
485486 }
0 commit comments