Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using Newtonsoft.Json;
- using RimWorld;
- using Verse;
- namespace my_new_mod {
- [StaticConstructorOnStartup]
- public static class Main {
- /**
- * Constructor
- */
- static Main() {
- // Outputs "Hello World!" to the dev console.
- Log.Message("Hello World!");
- string[] arr = new string[] { "Small", "Medium", "Large" };
- Type t = typeof(JsonConvert);
- Log.Message(t.ToString()); // Returns "Newtonsoft.Json.JsonConvert"
- Log.Message(JsonConvert.Undefined); // Returns "undefined"
- string json = JsonConvert.SerializeObject(arr, Formatting.Indented);
- Log.Message(json);
- /**
- Error in static constructor of Rim_my_new_mod.Main: System.TypeInitializationException: The type initializer for 'Rim_my_new_mod.Main' threw an exception. ---> System.TypeInitializationException: The type initializer for 'Newtonsoft.Json.JsonWriter' threw an exception. ---> System.TypeInitializationException: The type initializer for 'Newtonsoft.Json.Utilities.ConvertUtils' threw an exception. ---> System.TypeLoadException: Could not resolve type with token 01000024 (from typeref, class/assembly System.Numerics.BigInteger, System.Numerics, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)
- --- End of inner exception stack trace ---
- at Newtonsoft.Json.Utilities.EnumUtils.ToUInt64 (System.Object value) [0x00006] in <f74995119334484fb6db6825be2eac0d>:0
- at Newtonsoft.Json.Utilities.EnumUtils.InitializeValuesAndNames (Newtonsoft.Json.Utilities.StructMultiKey`2[T1,T2] key) [0x00045] in <f74995119334484fb6db6825be2eac0d>:0
- at (wrapper delegate-invoke) System.Func`2[Newtonsoft.Json.Utilities.StructMultiKey`2[System.Type,Newtonsoft.Json.Serialization.NamingStrategy],Newtonsoft.Json.Utilities.EnumInfo].invoke_TResult_T(Newtonsoft.Json.Utilities.StructMultiKey`2<System.Type, Newtonsoft.Json.Serialization.NamingStrategy>)
- at System.Collections.Concurrent.ConcurrentDictionary`2[TKey,TValue].GetOrAdd (TKey key, System.Func`2[T,TResult] valueFactory) [0x00034] in <eae584ce26bc40229c1b1aa476bfa589>:0
- at Newtonsoft.Json.Utilities.ThreadSafeStore`2[TKey,TValue].Get (TKey key) [0x00000] in <f74995119334484fb6db6825be2eac0d>:0
- at Newtonsoft.Json.Utilities.EnumUtils.GetEnumValuesAndNames (System.Type enumType) [0x0000c] in <f74995119334484fb6db6825be2eac0d>:0
- at Newtonsoft.Json.JsonWriter.BuildStateArray () [0x0001b] in <f74995119334484fb6db6825be2eac0d>:0
- at Newtonsoft.Json.JsonWriter..cctor () [0x000b3] in <f74995119334484fb6db6825be2eac0d>:0
- --- End of inner exception stack trace ---
- at Newtonsoft.Json.JsonTextWriter..ctor (System.IO.TextWriter textWriter) [0x00000] in <f74995119334484fb6db6825be2eac0d>:0
- at Newtonsoft.Json.JsonConvert.SerializeObjectInternal (System.Object value, System.Type type, Newtonsoft.Json.JsonSerializer jsonSerializer) [0x00015] in <f74995119334484fb6db6825be2eac0d>:0
- at Newtonsoft.Json.JsonConvert.SerializeObject (System.Object value, System.Type type, Newtonsoft.Json.Formatting formatting, Newtonsoft.Json.JsonSerializerSettings settings) [0x0000e] in <f74995119334484fb6db6825be2eac0d>:0
- at Newtonsoft.Json.JsonConvert.SerializeObject (System.Object value, Newtonsoft.Json.Formatting formatting, Newtonsoft.Json.JsonSerializerSettings settings) [0x00000] in <f74995119334484fb6db6825be2eac0d>:0
- at Newtonsoft.Json.JsonConvert.SerializeObject (System.Object value, Newtonsoft.Json.Formatting formatting) [0x00000] in <f74995119334484fb6db6825be2eac0d>:0
- at Rim_my_new_mod.Main..cctor () [0x0004d] in <554e655008644f43a47c5a6b2203e83e>:0
- --- End of inner exception stack trace ---
- at (wrapper managed-to-native) System.Runtime.CompilerServices.RuntimeHelpers.RunClassConstructor(intptr)
- at System.Runtime.CompilerServices.RuntimeHelpers.RunClassConstructor (System.RuntimeTypeHandle type) [0x0002a] in <eae584ce26bc40229c1b1aa476bfa589>:0
- at Verse.StaticConstructorOnStartupUtility.CallAll () [0x0001a] in <842a7a129d554204bf93f11a26f1d770>:0
- UnityEngine.StackTraceUtility:ExtractStackTrace ()
- Verse.Log:Error (string)
- Verse.StaticConstructorOnStartupUtility:CallAll ()
- Verse.PlayDataLoader/<>c:<DoPlayLoad>b__4_3 ()
- Verse.LongEventHandler:ExecuteToExecuteWhenFinished ()
- Verse.LongEventHandler:UpdateCurrentAsynchronousEvent ()
- Verse.LongEventHandler:LongEventsUpdate (bool&)
- (wrapper dynamic-method) Verse.Root:Verse.Root.Update_Patch1 (Verse.Root)
- Verse.Root_Entry:Update ()
- */
- }
- }
- }
Add Comment
Please, Sign In to add comment