GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — pythonnet/hotReloadCrashRepro at master · joshiKuldeep/pythonnet

Expand file tree

/

hotReloadCrashRepro

/
Copy path

Directory actions

More options

More options

Directory actions

More options

More options

Latest commit

 

History

History
History
 
 
/

hotReloadCrashRepro

/
Copy path

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Properties
Properties
 
 
App.config
App.config
 
 
Program.cs
Program.cs
 
 
README.txt
README.txt
 
 
hotReloadCrashRepro.csproj
hotReloadCrashRepro.csproj
 
 
theAssembly.cs
theAssembly.cs
 
 

README.txt

This project will reproduce the Python exception on second domain unload.
Make sure you use a version of Python .NET that calls PythonEngine.Shutdown() on DomainReload (starting with commit ###################)

How to repro:

1. Open hotReloadCrashRepro.csproj in Visual Studio 2017
2. Compile using the same platform as Python.Runtime.dll (e.g. x64)
3. Copy Python.Runtime.dll in the directory where hotReloadCrashRepro.exe is located (e.g. bin\x64\Debug)
4. Run "hotReloadCrashRepro.exe full_path_to_theAssembly.cs
    e.g. hotReloadCrashRepro.exe "D:\projects\pythonnet\hotReloadCrashRepro\theAssembly.cs"
    
The expected output is:    

[Program.Main] ===Pass #0===
[Program.Main] Creating the domain "My Domain 0"
[Program.Main] Building the assembly
[Proxy       ] In InitAssembly
[theAssembly ] PythonRunner.Init current domain = My Domain 0
[Proxy       ] In RunPython
[theAssembly ] In PythonRunner.RunPython
[Python      ] Done
[Program.Main] Before Domain Unload
[theAssembly ] In OnDomainUnload current domain = My Domain 0
[Program.Main] After Domain Unload
[Program.Main] The Proxy object is not valid anymore, domain unload complete.
[Program.Main] ===Pass #1===
[Program.Main] Creating the domain "My Domain 1"
[Proxy       ] In InitAssembly
[theAssembly ] PythonRunner.Init current domain = My Domain 1
[Proxy       ] In RunPython
[theAssembly ] In PythonRunner.RunPython
[Python      ] Done
[Program.Main] Before Domain Unload
[theAssembly ] In OnDomainUnload current domain = My Domain 1

Unhandled Exception: System.AppDomainUnloadedException: Attempted to access an unloaded AppDomain.
   at Python.Runtime.Runtime.Py_Finalize()
   at Python.Runtime.Runtime.Shutdown()
   at Python.Runtime.PythonEngine.Shutdown()
   at Python.Runtime.PythonEngine.OnDomainUnload(Object sender, EventArgs e)
[Program.Main] After Domain Unload
[Program.Main] The Proxy object is not valid anymore, domain unload complete.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.