Difficult Serialization type name change problem RRS feed

  • Question

  • So I have some tutorial files for a game that I am making. The serialized file contains an enum who's name I was forced to change to avoid a naming conflict inside the Unity game engine. Making these tutorial files was labor intensive and I can't remake them.

    The file contains a 2D array of class MapCell, and each MapCell contains a field of type Halo.Halotypes. The word 'Halo' now has a different meaning inside the Unity game engine and I can't use that as a class name anymore. I need to change the class name to 'RangeHalo'.

    The SaveFile class and the MapCell class have the [Serializable] attribute, and I use BinaryFormatter to save and load.

    How can I load the file with the old name and then save it with the new name? Making a new version of Halo will have wide impact across all my code, but renaming Halo to RangeHalo breaks my tutorial files.

    I need to save these files, every way I can thing to do it is a nightmare. I need help.

    Wednesday, February 13, 2019 9:18 PM

All replies

  • Hi floofthegoof,

    Thank you for posting here.

    For your question, you could the steps below to replace in files.

    Click Edit in Visual Studio menu> Find and Replace> Replace in Files


    Best Regards,


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, February 14, 2019 5:42 AM