I have been trying to enabling binary catalog in my project to improve load time, but I got some issues until I finally managed to properly load my app with some dirty hacks. I got “Invalid header data!!!” exception when loading the catalog on runtime platform, which according to source code, it’s due to different value of ContentCatalogData.kMagic
when the catalog is serialized on build pipeline, with the value when the catalog gets deserialized on runtime platform. I managed to resolve this by forcing this number to be deterministic and platform agnostic by using reflection. I’m not sure if this is the best way to resolve that, but it seems this header check is still present even in the latest version:
I believe we should not rely on string.GetHashCode
to check the header because it’s not guaranteed to be deterministic and platform agnostic. String.GetHashCode Method (System) | Microsoft Learn
But since the load time improved quite significantly, I would like to continue exploring to use this feature in my project. Please let me know if there’s better solution for this!