risk-of-thunder / R2API

A modding API for Risk of Rain 2
https://thunderstore.io/package/tristanmcpherson/R2API/
MIT License
136 stars 55 forks source link

Mono.Cecil version mismatch between R2API and Thubderstore BepInExPack breaks serialization in the unity editor. #520

Closed Nebby1999 closed 4 months ago

Nebby1999 commented 5 months ago

I've already spoken about this on the r2api channel in the modding discord, but in a nutshell, R2API's projects have a NuGet dependency on BepInExPack, which itself has a Dependency on Mono.Cecil version 0.11.4

The problem arises on the fact that the Thunderstore version of BepInEx is uploaded with Mono.Cecil version 0.10.4, while this did not cause any issues on Unity version 2019.4.26, it causes R2API's assemblies to Unload on version 2019.4.37. Causing certain features to not work properly in the editor (such as Scriptable objects using Serializable classes.)

This can either be fixed by making the BepInEx version use 0.11.4 or r2api downgrading to use Mono.Cecil version 0.10.4

Nebby1999 commented 5 months ago

https://discord.com/channels/562704639141740588/567836513078083584/1245173108248150129

This link is for a Message where my investigation led me to believe this version mismatch is the problem

Nebby1999 commented 5 months ago

After some attempts on the team we managed to hack this mono.cecil dll that says its 0.10.4, while unity spills warnings the actual issues described above get fixed.

Mono.Cecil.dll.zip

Bepinex should now be reuploaded to thunderstore using this .dll

xiaoxiao921 commented 4 months ago

Fixed by https://github.com/risk-of-thunder/BepInEx/commit/6286b341d3ca9438ea3e5b25129c0759b51f01bc