SMAPI - Stardew Modding API

SMAPI - Stardew Modding API

971k Downloads

Rewrite mod assembly loading

Pathoschild opened this issue ยท 4 comments

commented

The current mod assembly loading is complex, causes user-visible changes (the .cache folders), has a naive load order that fails in some scenarios (e.g. #226), and suffers from difficult-to-diagnose bugs (e.g. #221).

commented

Done in develop for the upcoming 1.8 release. The new implementation is much simpler, eliminates the .cache folders by loading assemblies from memory, ensures DLLs are loaded in leaf-to-root order, has improved dependent assembly resolution, and reduces log verbosity. These changes should address a range of issues, notably #221 and #226.

Note: this will break any mods which use properties like Assembly.GetExecutingAssembly().Location instead of the helpers provided by SMAPI (like helper.ReadConfig<T>() or helper.DirectoryPath).

commented

This breaks the Visual Studio debugger as-is, probably because SMAPI no longer loads the assembly file from disk.

commented

Fixed in develop by only loading the assembly from memory if it was rewritten.

commented

This seems to be working per beta testing, so I'll close it now. We can reopen if something comes up.