Description
Describe the bug 🐞
It appears that ReactiveUI (RxUI) cannot be used in conjunction with Assembly Load Contexts (ALCs).
Relevant documentation:
Step to reproduce
- Load ReactiveUI into ALC
- Unload ALC
- Reload ALC
Any .WhenAnyValue()
subscriptions will generate a TypeLoadException
.
Reproduction repository
https://github.com/guillermooo/rxui-alc
Expected behavior
ReactiveUI should support ALCs correctly.
Screenshots 🖼️
No response
IDE
No response
Operating system
Windows
Version
No response
Device
No response
ReactiveUI Version
All
Additional information ℹ️
I haven't been able to find the root of the issue, but I've explored Type
caches such as the one used by ReactiveUI.Reflection.ReallyFindType()
and lingering references in Splat's registry without much success so far. But I admit I'm not sure what I should be looking for. I have not tried using WinDbg yet, in spite of being the suggested approach by the .NET documentation linked above.
The only lead I could find to date is that the Splat registry does seem to be pristine when the ALC first loads, and polluted after the ALC is reloaded.
If no fix is found, at least determine that RxUI is incompatible with ALCs due to DLL unloadability issues and document the limitation prominently.