I've been using Giles and the "Play Custom Map" will seemingly randomly spit out this error when loading a particular level. This level would load fine just 5 minutes ago.
InvalidOperationException: Current error context error is different to requested error. Newtonsoft.Json.Serialization.JsonSerializerInternalBase.GetErrorContext (System.Object currentObject, System.Object member, System.String path, System.Exception error) (at C:/Users/George/Downloads/Json.Net.Unity3D-master/Json.Net.Unity3D-master/src/Newtonsoft.Json/Serialization/JsonSerializerInternalBase.cs:93) Newtonsoft.Json.Serialization.JsonSerializerInternalBase.IsErrorHandled (System.Object currentObject, Newtonsoft.Json.Serialization.JsonContract contract, System.Object keyValue, IJsonLineInfo lineInfo, System.String path, System.Exception ex) (at C:/Users/George/Downloads/Json.Net.Unity3D-master/Json.Net.Unity3D-master/src/Newtonsoft.Json/Serialization/JsonSerializerInternalBase.cs:111) Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize (Newtonsoft.Json.JsonReader reader, System.Type objectType, Boolean checkAdditionalContent) (at C:/Users/George/Downloads/Json.Net.Unity3D-master/Json.Net.Unity3D-master/src/Newtonsoft.Json/Serialization/JsonSerializerInternalReader.cs:182) Newtonsoft.Json.JsonSerializer.DeserializeInternal (Newtonsoft.Json.JsonReader reader, System.Type objectType) (at C:/Users/George/Downloads/Json.Net.Unity3D-master/Json.Net.Unity3D-master/src/Newtonsoft.Json/JsonSerializer.cs:823) Newtonsoft.Json.JsonSerializer.Deserialize (Newtonsoft.Json.JsonReader reader, System.Type objectType) (at C:/Users/George/Downloads/Json.Net.Unity3D-master/Json.Net.Unity3D-master/src/Newtonsoft.Json/JsonSerializer.cs:802) Newtonsoft.Json.JsonConvert.DeserializeObject (System.String value, System.Type type, Newtonsoft.Json.JsonSerializerSettings settings) (at C:/Users/George/Downloads/Json.Net.Unity3D-master/Json.Net.Unity3D-master/src/Newtonsoft.Json/JsonConvert.cs:865) Newtonsoft.Json.JsonConvert.DeserializeObject[pb_SceneNode] (System.String value, Newtonsoft.Json.JsonSerializerSettings settings) (at C:/Users/George/Downloads/Json.Net.Unity3D-master/Json.Net.Unity3D-master/src/Newtonsoft.Json/JsonConvert.cs:822) GILES.pb_Scene.LoadLevel (System.String levelJson) (at Assets/Lib Assets/GILES/Code/Scripts/pb_Scene.cs:157) GILES.Example.pb_SceneLoader.OnLevelWasLoaded (Int32 i) (at Assets/Lib Assets/GILES/Code/Scripts/pb_SceneLoader.cs:47)
I've loaded levels and they usually work fine. Minutes later some levels start spitting out this error. I've tried making duplicates of the .json files to see if the .json file is corrupted somehow but the json file is identical. Remaking the file from scratch always fixes the problem temporarily.
I've pulled the Unity Json project from https://github.com/SaladLab/Json.Net.Unity3D and built my own .dll and .pdb files so I can look deeper into what's going on. Inside json it throws the exception basically at this line https://github.com/SaladLab/Json.Net.Unity3D/blob/master/src/Newtonsoft.Json/Serialization/JsonSerializerInternalReader.cs#L182. The exception has a stacktrace of this:
at System.Reflection.MonoCMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x0012c] in /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:519 at System.Reflection.MonoCMethod.Invoke (BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:528 at System.Reflection.ConstructorInfo.Invoke (System.Object[] parameters) [0x0000e] in /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/ConstructorInfo.cs:77 at Newtonsoft.Json.Utilities.LateBoundReflectionDelegateFactory+<>c__DisplayClass3_0.<CreateParameterizedConstructor>b__0 (System.Object[] a) [0x00003] in C:\\Users\\George\\Downloads\\Json.Net.Unity3D-master\\Json.Net.Unity3D-master\\src\\Newtonsoft.Json\\Utilities\\LateBoundReflectionDelegateFactory.cs:59 at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateISerializable (Newtonsoft.Json.JsonReader reader, Newtonsoft.Json.Serialization.JsonISerializableContract contract, Newtonsoft.Json.Serialization.JsonProperty member, System.String id) [0x00197] in C:\\Users\\George\\Downloads\\Json.Net.Unity3D-master\\Json.Net.Unity3D-master\\src\\Newtonsoft.Json\\Serialization\\JsonSerializerInternalReader.cs:1746 at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject (Newtonsoft.Json.JsonReader reader, System.Type objectType, Newtonsoft.Json.Serialization.JsonContract contract, Newtonsoft.Json.Serialization.JsonProperty member, Newtonsoft.Json.Serialization.JsonContainerContract containerContract, Newtonsoft.Json.Serialization.JsonProperty containerMember, System.Object existingValue) [0x00410] in C:\\Users\\George\\Downloads\\Json.Net.Unity3D-master\\Json.Net.Unity3D-master\\src\\Newtonsoft.Json\\Serialization\\JsonSerializerInternalReader.cs:587 at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal (Newtonsoft.Json.JsonReader reader, System.Type objectType, Newtonsoft.Json.Serialization.JsonContract contract, Newtonsoft.Json.Serialization.JsonProperty member, Newtonsoft.Json.Serialization.JsonContainerContract containerContract, Newtonsoft.Json.Serialization.JsonProperty containerMember, System.Object existingValue) [0x0007c] in C:\\Users\\George\\Downloads\\Json.Net.Unity3D-master\\Json.Net.Unity3D-master\\src\\Newtonsoft.Json\\Serialization\\JsonSerializerInternalReader.cs:293 at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize (Newtonsoft.Json.JsonReader reader, System.Type objectType, Boolean checkAdditionalContent) [0x000a6] in C:\\Users\\George\\Downloads\\Json.Net.Unity3D-master\\Json.Net.Unity3D-master\\src\\Newtonsoft.Json\\Serialization\\JsonSerializerInternalReader.cs:167
So now I'm not sure if it's because I'm using procore meshes as prefabs, prefabs with children, or json is invoking a method that doesn't exist.