nwn-dotnet / Anvil

A Neverwinter Nights Server API
https://nwn-dotnet.github.io/Anvil
MIT License
24 stars 9 forks source link

Plugin Reload: Migrate to System.Text.Json #390

Open Jorteck opened 3 years ago

Jorteck commented 3 years ago

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.

Jorteck commented 2 years ago

Should not start working on this until we have appropriate test coverage: https://github.com/nwn-dotnet/Anvil/issues/463

Samuel-IH commented 1 year ago

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