Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Exception thrown when initializing Python .NET after a domain unload #714

Closed
@lassond

Description

@lassond

Environment

  • Pythonnet version: latest master commit as of 2018-08-09 (fb84cd2 )

  • Python version:
    Python 2.7.15 (v2.7.15:ca079a3ea3, Apr 30 2018, 16:30:26) [MSC v.1500 64 bit (AMD64)] on win32

  • Operating System:
    Windows 10

  • In the context of running in Unity, but also reproducible in a simple standalone app made from scratch

Details

Unity, whenever a C# script is changed, the AppDomain in which the Assemblies are loaded gets unloaded. Then, Unity creates a fresh AppDomain, recompiles the C# assemblies and loads them again.

The Python.Runtime assembly gets unloaded, but the Python interpreter survives (it is a native library). This results in an inconsistent state between the Python .NET Engine/Runtime classes (which are not initialized) and the Python interpreter (which is initialized).

An exception is raised when Python .NET accesses the interpreter (System.AppDomainUnloadedException: Attempted to access an unloaded AppDomain.)

  • Describe what you were trying to get done.

See above

I will attach my standalone application which reproduces this crash along with the repro steps. (either ere or on the pull request if I cannot attach here)

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


      [8]ページ先頭

      ©2009-2025 Movatter.jp