Search Issue Tracker

Fixed in 2022.1.X

Fixed in 2021.2.X



Found in




Issue ID




[IL2CPP]System.Runtime.Serialization.Formatters.BinaryFormatter doesn't work when Project is build with IL2CPP Scripting Backend



Reproduction steps:
1. Open the attached project ""
2. In File > Build Settings, make sure that Scenes/SampleScene is added to Scenes In Build
3. In Player settings change Scripting Backend to the IL2CPP
4. Build and Run
5. Observe the Build

Expected result: Data is serialized successfully
Actual result: Binary Formatter discards data, serialization fails

Reproducible with: 2021.2.0a18, 2021.2.0b16, 2022.1.0a13
Not reproducible with: 2019.4.32f1, 2020.3.21f1, 2021.1.27f1, 2021.2.0a17

- The issue is not reproducible with Mono Scripting Backend

  1. Resolution Note (fix version 2022.1):

    Fixed in: 2022.1.0b1

  2. Resolution Note (fix version 2021.2):

    Fixed in: 2021.2.3f1

Comments (7)

  1. MaskedMouse

    Nov 05, 2021 13:09

    People stop using the binary formatter it is NOT safe. Even the microsoft documentation says so.
    IMO Unity should warn developers using this API

  2. james_work

    Nov 05, 2021 02:03

    +1 This is the only thing blocking our upgrade to 2021.2, would appreciate a fix ASAP.

  3. MrDizzle26

    Oct 29, 2021 15:03

    This is an extremely important issue for our team, we are stuck on the very unstable b1 until this is resolved

  4. Shii

    Oct 28, 2021 10:25

    This is the only one know issue in 2021.2 that preventing us upgrading our project from 2020.3. Please fix it!

  5. Johnroy3

    Oct 27, 2021 21:24

    Can someone please fix this? Like, right now :/

  6. gamefox87

    Oct 27, 2021 21:18

    Please fix this ASAP.

  7. Kunnogi

    Oct 27, 2021 21:17

    Definitely requires to be fixed, very important issue, should be fixed ASAP.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.