Search Unity

Bug Editor Crash after upgrade (2021.2.13): Mono "Instance ByRefLike field not in a ref struct"

Discussion in 'Editor & General Support' started by nogxx, Mar 1, 2022.

  1. nogxx

    nogxx

    Joined:
    Sep 9, 2019
    Posts:
    3
    Hello,

    I upgraded Unity from 2019.4.16 to 2021.2.13. Ever since, my editor keeps crashing when I open my project. I've attached my editor logs, but the culprit is the following error:


    The code which produces the error is from a plugin I've added to my project called StackExchange.Redis. https://github.com/StackExchange/StackExchange.Redis
    Said plugin has a ref struct called BufferReader https://github.com/StackExchange/St.../main/src/StackExchange.Redis/BufferReader.cs

    If I understand the error message correctly, it points to the Instance ByRefLike field '_current' in that struct, saying that it is not inside another ref struct. Which if you look at the BufferReader type, is clearly not the case.

    This is not an issue on 2021.1.x or lower versions. Unfortunately, there's a feature in 2021.2 that I want, so downgrading is not an option.

    Any possible fix, workaround, or just help in general much appreciated!
     

    Attached Files:

    Last edited: Mar 1, 2022
  2. nogxx

    nogxx

    Joined:
    Sep 9, 2019
    Posts:
    3