Skip to content

Commit c2b52bb

Browse files
fix(core): disable autoReferenced on HotUpdate.Code asmdef
Hot-update assemblies are loaded at runtime by Bootstrap; they should not be compile-referenced by Unity's predefined assemblies (Assembly-CSharp, Assembly-CSharp-firstpass). With autoReferenced=true, any Assembly-CSharp source that uses a HotUpdate.Code.* type embeds a real assembly reference into Assembly-CSharp's metadata. During the Unity player build, HybridCLR's FilterHotFixAssemblies (IFilterBuildAssemblies) correctly strips HotUpdate.Code from the player staging area. Obfuz's ObfuscationProcess (IPostBuildPlayerScriptDLLs) then tries to obfuscate Assembly-CSharp and recursively resolves its assembly refs via AssemblyCache.LoadModule (Obfuz Editor/Utils/AssemblyCache.cs:75-97). The HotUpdate.Code ref can't be resolved from the player search paths, so obfuscation throws FileNotFoundException: Assembly HotUpdate.Code not found. Setting autoReferenced=false removes the trigger for template users: Assembly-CSharp no longer auto-references HotUpdate.Code, so nothing forces the metadata ref, and Obfuz's recursive resolver never asks for HotUpdate.Code. Verified safe for the current template: PromptInitializer references only JEngine.Core / JEngine.UI, and AOTGenericReferences.cs emits HotUpdate.Code.* entries as comments only (GenericReferenceWriter.cs:72-127). Signed-off-by: JasonXuDeveloper - 傑 <jason@xgamedev.net>
1 parent ea90126 commit c2b52bb

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

UnityProject/Assets/HotUpdate/Code/HotUpdate.Code.asmdef

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"allowUnsafeCode": false,
1919
"overrideReferences": false,
2020
"precompiledReferences": [],
21-
"autoReferenced": true,
21+
"autoReferenced": false,
2222
"defineConstraints": [],
2323
"versionDefines": [],
2424
"noEngineReferences": false

0 commit comments

Comments
 (0)