Quantcast
Channel: Questions in topic: "dll"
Viewing all articles
Browse latest Browse all 706

calling Encoding.UTF8.GetBytes(JSON) in a dll causes exception, while in src format everything works great.

$
0
0
This is so weird, I can't even explain it. I've created an application to add some functionality to my unity game. Everything works fine when I ran the same steps from unity. The steps: 1. Create a class. 2. Convert it to JSON. (Using Newtonsoft.Json package) 3. Add the converted class to another class as a member. 4. convert that class to JSON as well 5. run Encoding.UTF8.GetBNytes(json) It works great when I copy the source files and run them via unity(in the editor), but every time I build it alone and add the DLL, unity raises an exception at the Byte convert stage (I know this because I have tried commenting out every part of the code, and that's the only part that's failing) This is the error - TypeLoadException: Could not resolve type with token 01000019 (from typeref, class/assembly System.Text.Encoding, System.Runtime, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a) MercurySDK.MercuryClient.CreatePlayer (System.String client, System.String id, System.String type, System.String teamId, System.Single[] location) (at <59a6b6b960504910bd482e9be83660f7>:0) PlayerController.Start () (at Assets/Scripts/PlayerController.cs:21) I've tried switching to ASCII but it still failed. What should I do? :(

Viewing all articles
Browse latest Browse all 706

Trending Articles