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 }}
This repository has been archived by the owner on Feb 28, 2024. It is now read-only.
This would make mod development easier because we would not need to fully close and reopen Neos every time we make a change. It could also pave the way for automatic mod updates inside of Neos.
As far as I know, the main thing stopping this is that in C# you cannot load the DLL again if it contains the same class name. A way around this could be for NML to randomize the class names somehow. This was discussed a little with @art0007i already.
Could potentially be used when launching NML in Debug mode instead of enabling it by default.
The text was updated successfully, but these errors were encountered:
Nytra
changed the title
[Feature Request] Hot-reloading DLL's
[Feature Request] Hot-reloading DLLs
Apr 29, 2023
we have looked into this in the past and the biggest challenge is unloading the prior assembly. this was requested in our discord server in this discussion thread
its certainly something that would be nice to have, we just have to do it well while dealing with c#
not sure how we should tell the mod its being hot reloaded but #55 comes to mind with discussions on a similar topic.
something id like to look into is what bepinex does for hotreloading
well you don't need to unload dlls. you would just need to load the new dll and make sure to "deactivate" the old dll, I assume hot reload is specifically for development so leaking a bit of memory and writing a destructor function for your mod should be doable and still be useful.
There might also be cross mod bugs caused by this but again for a development version it should be ok.
I've already tried the double load method, and it didn't actually load the new code for some reason. the LoadAssembly function just returned the exact same assembly as the original one, even though it was a different file path and the code was also different. I didn't bother with figuring out more about why this happens. I might look through my files and see if I have that version of modloader that tried to hot "re"load (double load?) mods but like it didn't work, only because c# refused to work with me.
This would make mod development easier because we would not need to fully close and reopen Neos every time we make a change. It could also pave the way for automatic mod updates inside of Neos.
As far as I know, the main thing stopping this is that in C# you cannot load the DLL again if it contains the same class name. A way around this could be for NML to randomize the class names somehow. This was discussed a little with @art0007i already.
Could potentially be used when launching NML in Debug mode instead of enabling it by default.
The text was updated successfully, but these errors were encountered: