Anvil
Anvil copied to clipboard
Plugin Reload: Migrate to System.Text.Json
With the addition of the NUI API, an extra dependency was added to Newtonsoft.Json due to its simplicity for serializing polymorphic objects.
Unfortunately it has a few issues from sometimes holding hard dependencies to plugins, preventing AssemblyLoadContexts from being unloading and causing hot reloads to fail.
Should not start working on this until we have appropriate test coverage: https://github.com/nwn-dotnet/Anvil/issues/463
Just saw this! While this is a long ways away, I'd like to mention that System.Text.Json may not solve the issue. I've used it in one of my plugins to help with hot reloading with no success. I certainly could be missing something in my setup, but this issue was pretty convincing to me: https://github.com/dotnet/runtime/issues/65323
I ended up having to use Jil instead: https://github.com/kevin-montrose/Jil