Prototype icon indicating copy to clipboard operation
Prototype copied to clipboard

Assembly unloading fails

Open esbudylin opened this issue 5 months ago • 1 comments

I'm experiencing issues with assembly unloading while using the editor (https://github.com/godotengine/godot/issues/78513). Basically, it means that the editor requires a restart on every rebuild.

I first assumed it was caused by the version update (we recently upgraded the Godot version from 4.2 to 4.4), but the downgrade didn't fix it for me. Judging by the discussion in the linked issue, the issue is actually caused by using some incompatible library in a [Tool] script. It's likely the System.Text.Json that is causing problems, since it doesn't support assembly unloading.

To fix it, we should identify [Tool] scripts that depends on the JSON library and either rewrite them to remove the dependency or downgrade them from [Tool] scripts to regular ones. The most likely offenders are WorldSetup, PlayerSetup, and ScenarioSetup.

esbudylin avatar Aug 17 '25 13:08 esbudylin

I've noticed that the problem persists after my fixes (I'm not sure why I didn't noticed it when I submitted the PR). It's probably worth going through the [Tool] scripts one by one to see which one is causing the problem. Right now it doesn't seem like we are executing any code from the JSON library in the tool scripts.

esbudylin avatar Sep 11 '25 18:09 esbudylin