You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Soft reload throws in deserialization in a common workflow #1250
Expected: Python for .NET is available after reload. Running Python code again will raise AttributeError.
Actual: Python for .NET throws SerializationException: Cannot get the member 'Quux'. I can't even run the Python code again; it fails on import clr. I must restart Unity.
Similarly if I rename the class, the namespace, or the assembly.
The problem appears to be in ManagedType subclasses. These are [Serializable] but they point to things like Type whose deserialization may fail, destroying everything.
I'm working on a proof of concept so that we control the deserialization and we can replace the failed deserialize with a dummy or a null, which only fails if this eventually gets used. I'll post results tomorrow hopefully on a first attempt.
Activity
benoithudson commentedon Oct 9, 2020
Proof of concept:
1250.txt
This fixes this particular bug. I can reload, no error. This isn't a PR yet since there's no testing; and I haven't even thought about performance.
We'll have to audit all the ManagedType subclasses and fix them in this style.
Bug 1250: fix for missing FieldInfo
Bug 1250: fix for missing FieldInfo
benoithudson commentedon Jan 19, 2021
#1287 fixes much more than this test case.