Changes

Jump to navigation Jump to search
Line 111: Line 111:     
See [[../Update checks|''update checks'']] for more information.
 
See [[../Update checks|''update checks'']] for more information.
 +
 +
==Specialized fields==
 +
'''⚠️ Most mods shouldn't need to use these fields.'''
 +
 +
===Private assemblies===
 +
{{SMAPI upcoming|4.1.0|content=
 +
A ''private assembly'' is a DLL which only one mod can reference. This ensures that the mod has the exact version it was designed for, and lets different mods use different versions of the same assembly. You can use this even if another copy of the assembly was already loaded by SMAPI or another mod.
 +
 +
Caveats:
 +
* Each private copy of a DLL has ''separate'' static values. Don't use this for assemblies that need to share global state (e.g. Harmony).
 +
* The DLL needs to be in your mod folder.
 +
 +
You must specify the assembly name (without the version, culture, and private key). For example:
 +
<syntaxhighlight lang="javascript">
 +
"PrivateAssemblies": [
 +
  {
 +
      "Name": "Newtonsoft.Json"
 +
  }
 +
]
 +
</syntaxhighlight>
 +
 +
SMAPI will log a warning if it doesn't detect a reference to the DLL, which is usually a mistake. If that's deliberate (e.g. you're accessing it through reflection), you can suppress that warning:
 +
<syntaxhighlight lang="javascript">
 +
"PrivateAssemblies": [
 +
  {
 +
      "Name": "Newtonsoft.Json",
 +
      "UsedDynamically": true // not recommended -- only set if DLL is accessed in a special way
 +
  }
 +
]
 +
</syntaxhighlight>
 +
}}
    
===Anything else===
 
===Anything else===
translators
8,488

edits

Navigation menu