-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Closed
Description
public class TestClass
{
public string Text { get; set; }
public int Count { get; set; }
}
var json = JsonConvert.SerializeObject(new TestClass { Count = 123, Text = "test" });MonoPlatform.ts:201 WASM: Newtonsoft.Json.JsonSerializationException: Error getting value from 'Text' on 'WebApplication13.TestClass'. ---> System.NullReferenceException: Object reference not set to an instance of an object.
MonoPlatform.ts:201 WASM: at System.Linq.Expressions.Interpreter.LightLambda.MakeRunDelegateCtor (System.Type delegateType) <0x2117f60 + 0x00284> in <760928a9a61c41298fde6b316420d144>:0
MonoPlatform.ts:201 WASM: at System.Linq.Expressions.Interpreter.LightLambda.GetRunDelegateCtor (System.Type delegateType) <0x2113198 + 0x00048> in <760928a9a61c41298fde6b316420d144>:0
MonoPlatform.ts:201 WASM: at System.Linq.Expressions.Interpreter.LightLambda.MakeDelegate (System.Type delegateType) <0x2113010 + 0x0000e> in <760928a9a61c41298fde6b316420d144>:0
MonoPlatform.ts:201 WASM: at System.Linq.Expressions.Interpreter.LightDelegateCreator.CreateDelegate (System.Runtime.CompilerServices.IStrongBox[] closure) <0x21126e0 + 0x00024> in <760928a9a61c41298fde6b316420d144>:0
MonoPlatform.ts:201 WASM: at System.Linq.Expressions.Interpreter.LightDelegateCreator.CreateDelegate () <0x2112570 + 0x0000a> in <760928a9a61c41298fde6b316420d144>:0
MonoPlatform.ts:201 WASM: at System.Linq.Expressions.LambdaExpression.Compile (System.Boolean preferInterpretation) <0x20e2c90 + 0x00018> in <760928a9a61c41298fde6b316420d144>:0
MonoPlatform.ts:201 WASM: at System.Linq.Expressions.LambdaExpression.Compile () <0x20e2a78 + 0x0000a> in <760928a9a61c41298fde6b316420d144>:0
MonoPlatform.ts:201 WASM: at Newtonsoft.Json.Utilities.ExpressionReflectionDelegateFactory.CreateGet[T] (System.Reflection.PropertyInfo propertyInfo) <0x21cd310 + 0x000dc> in <d32db49e5e3440729da31845c03ddc3a>:0
MonoPlatform.ts:201 WASM: at Newtonsoft.Json.Utilities.ReflectionDelegateFactory.CreateGet[T] (System.Reflection.MemberInfo memberInfo) <0x21cd0a8 + 0x00056> in <d32db49e5e3440729da31845c03ddc3a>:0
MonoPlatform.ts:201 WASM: at Newtonsoft.Json.Serialization.ExpressionValueProvider.GetValue (System.Object target) <0x21ccea8 + 0x0002a> in <d32db49e5e3440729da31845c03ddc3a>:0
MonoPlatform.ts:201 WASM: --- End of inner exception stack trace ---
MonoPlatform.ts:201 WASM: at Newtonsoft.Json.Serialization.ExpressionValueProvider.GetValue (System.Object target) <0x21ccea8 + 0x00082> in <d32db49e5e3440729da31845c03ddc3a>:0
MonoPlatform.ts:201 WASM: at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.CalculatePropertyValues (Newtonsoft.Json.JsonWriter writer, System.Object value, Newtonsoft.Json.Serialization.JsonContainerContract contract, Newtonsoft.Json.Serialization.JsonProperty member, Newtonsoft.Json.Serialization.JsonProperty property, Newtonsoft.Json.Serialization.JsonContract& memberContract, System.Object& memberValue) <0x21cc3f0 + 0x000c6> in <d32db49e5e3440729da31845c03ddc3a>:0
MonoPlatform.ts:201 WASM: at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeObject (Newtonsoft.Json.JsonWriter writer, System.Object value, Newtonsoft.Json.Serialization.JsonObjectContract contract, Newtonsoft.Json.Serialization.JsonProperty member, Newtonsoft.Json.Serialization.JsonContainerContract collectionContract, Newtonsoft.Json.Serialization.JsonProperty containerProperty) <0x21c9530 + 0x00144> in <d32db49e5e3440729da31845c03ddc3a>:0
MonoPlatform.ts:201 WASM: at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeValue (Newtonsoft.Json.JsonWriter writer, System.Object value, Newtonsoft.Json.Serialization.JsonContract valueContract, Newtonsoft.Json.Serialization.JsonProperty member, Newtonsoft.Json.Serialization.JsonContainerContract containerContract, Newtonsoft.Json.Serialization.JsonProperty containerProperty) <0x20b2b60 + 0x0016c> in <d32db49e5e3440729da31845c03ddc3a>:0
MonoPlatform.ts:201 WASM: at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.Serialize (Newtonsoft.Json.JsonWriter jsonWriter, System.Object value, System.Type objectType) <0x1eabcd8 + 0x000e8> in <d32db49e5e3440729da31845c03ddc3a>:0
MonoPlatform.ts:201 WASM: at Newtonsoft.Json.JsonSerializer.SerializeInternal (Newtonsoft.Json.JsonWriter jsonWriter, System.Object value, System.Type objectType) <0x1ea6ee8 + 0x003bc> in <d32db49e5e3440729da31845c03ddc3a>:0
MonoPlatform.ts:201 WASM: at Newtonsoft.Json.JsonSerializer.Serialize (Newtonsoft.Json.JsonWriter jsonWriter, System.Object value, System.Type objectType) <0x1ea5b48 + 0x00024> in <d32db49e5e3440729da31845c03ddc3a>:0
MonoPlatform.ts:201 WASM: at Newtonsoft.Json.JsonConvert.SerializeObjectInternal (System.Object value, System.Type type, Newtonsoft.Json.JsonSerializer jsonSerializer) <0x1e56558 + 0x00054> in <d32db49e5e3440729da31845c03ddc3a>:0
MonoPlatform.ts:201 WASM: at Newtonsoft.Json.JsonConvert.SerializeObject (System.Object value, System.Type type, Newtonsoft.Json.JsonSerializerSettings settings) <0x1e30468 + 0x00026> in <d32db49e5e3440729da31845c03ddc3a>:0
MonoPlatform.ts:201 WASM: at Newtonsoft.Json.JsonConvert.SerializeObject (System.Object value) <0x1e301e8 + 0x0000c> in <d32db49e5e3440729da31845c03ddc3a>:0
MonoPlatform.ts:201 WASM: at WebApplication13.Pages.FetchData.OnInitAsync () <0x1cb6918 + 0x00174> in <2479154c00aa49c984bebd3cc55199f5>:0
Reactions are currently unavailable