Weird cast
Is the same issue as https://github.com/icsharpcode/ILSpy/issues/3011?
Hard to say without taking a look at the IL...
Yes, in this assembly the code is trying to assign an array of type System.Byte from mscorlib v2 to a variable of type array of type System.Byte from mscorlib v4. This causes these weird casts.
How about those Unsafe.As? Is also the same issue?
@dgrunwald do you think it would make sense to do "unification" of well-known/special types in the type-system?
I think this makes more sense as a job for the assembly resolver -- there shouldn't be multiple mscorlibs in the same compilation. If we let both assemblyrefs resolve to the newer mscorlib version, then the typerefs will also resolve to the same type and the casts are avoided.