SMAPI - Stardew Modding API

SMAPI - Stardew Modding API

971k Downloads

Improve handling of missing assembly references in mods

Pathoschild opened this issue ยท 3 comments

commented

When a mod references an assembly that's not loaded, it can cause a flood of errors in the log file and improper mod functionality. Improve how that's handled.

commented

We can group missing assembly references into two groups:

  1. A mod references a framework mod (like Entoarox Framework) without marking it as a dependency (e.g. because it predates the dependency feature or the author just forgot). Proposed solution: add a list of common framework mods in StardewModdingAPI.config.json, detect missing references to them, and treat them as a dependency automatically.
  2. A mod references an unknown assembly (e.g. a DLL they forgot to include, an unknown mod, a third-party assembly like Harmony, etc). Proposed solution: detect broken references and treat them as a mod load error.
commented
  1. A mod references a assembly that the bundled mono for osx does not include.
    Proposed solution: Jail-break out of that limiting box that is making modding a pain.
commented

Done in develop for the upcoming SMAPI 2.6 beta.

If there's no listed mod dependency, a broken assembly reference is now treated as a compatibility error. The trace logs will show a relevant message:

Broken code in ExampleMod.dll: reference to missing assembly 'EntoaroxFramework, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null'.

And SMAPI will list it as a broken mod:

Skipped 1 mod:
Example Mod 1.0 because it's no longer compatible. Please check for a new version at https://www.nexusmods.com/stardewvalley/mods/2400 or https://smapi.io/compat.