C#/Mono: Calling Game.GenerateHash(string) causes a System.BadImageFormatException


If you post here without knowing what you’re doing you’ll most likely get suspended, you should probably post in #client-support instead.

Description: Calling Game.GenerateHash(string) causes a System.BadImageFormatException
Server artifact version: N/A (Build |1436.31| [RedM] Manifest 13523)
Expected behavior: It gets the hash and doesn’t raises an exception
Current behavior: Throws System.BadImageFormatException
Error screenshot: N/A
.dmp/crash files: N/A
Files/Code to reproduce bug:

using System;
using System.Threading.Tasks;
using CitizenFX.Core;

namespace Test.Client
    public class Test : BaseScript
        public Test()
            Tick += OnTick;

        private async Task OnTick()
            Debug.WriteLine("Before Hash");

            int hash = Game.GenerateHash("OVERCAST");
            Debug.WriteLine("After Hash");
            Debug.WriteLine(Convert.ToString(hash, 16));

            Debug.WriteLine("After Print");

Extra information:

[   3319515] [b1436_GTAProce]             MainThrd/ Failed to run a tick for Test: System.BadImageFormatException: Error verifying Test.Client.Test/<OnTick>d__1:MoveNext (): Cannot load method from token 0x0a000026 for call at 0x0019

[   3319515] [b1436_GTAProce]             MainThrd/   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine] (TStateMachine& stateMachine) [0x0002c] in <74fbbe963b7e417b8d715b858c5c584f>:0 

[   3319515] [b1436_GTAProce]             MainThrd/   at Test.Client.Test.OnTick () [0x0001f] in <ac44c9c6a5854b4e86bf8b52e5c7c74e>:0 

[   3319515] [b1436_GTAProce]             MainThrd/   at CitizenFX.Core.BaseScript+<>c__DisplayClass33_1.<ScheduleTick>b__1 () [0x00049] in C:\gl\builds\master\fivem\code\client\clrcore\BaseScript.cs:176 

[   3319515] [b1436_GTAProce]             MainThrd/   at System.Threading.Tasks.Task`1[TResult].InnerInvoke () [0x0000f] in <74fbbe963b7e417b8d715b858c5c584f>:0 

[   3319531] [b1436_GTAProce]             MainThrd/   at System.Threading.Tasks.Task.Execute () [0x00010] in <74fbbe963b7e417b8d715b858c5c584f>:0 
[   3319531] [b1436_GTAProce]             MainThrd/