json.net Questions

4

Solved

A relatively new addition to JSON Schema (draft-07) adds the if, then and else keywords. I cannot work out how to use these new keywords correctly. Here is my JSON Schema so far: { "type&quot...
Ginnifer asked 26/7, 2018 at 13:5

2

I have upgraded Visual studio 2022 to the latest updated release 17.7.4 from the previous build. From then, I'm getting an error "Internal error in Visualizer" when trying to visualize a ...
Kyne asked 4/10, 2023 at 8:36

4

Solved

I've got an object in my project with circular references. I've put [JsonIgnore] above the field like so: [JsonIgnore] public virtual Foobar ChildObject { get; set; } I'm still getting circular re...
Kalif asked 1/6, 2010 at 23:26

5

What exceptions does Newtonsoft.Json.DeserializeObject throw? I want to handle them. http://james.newtonking.com/json/help/?topic=html/M_Newtonsoft_Json_JsonConvert_DeserializeObject.htm#seeAlsoTo...
Affiliate asked 8/10, 2014 at 19:6

3

Solved

What is the equivalent of Newtonsoft.Json's JsonProperty attribute in System.Text.Json? Example: using Newtonsoft.Json; public class Example { [JsonProperty("test2")] public string Tes...
Rabinowitz asked 20/10, 2019 at 17:46

3

Solved

I've got a C# application that uses Json.NET v7.0.1. As a result of a REST call, I get back some JSON in the form of: { "messages": [ {"phoneNumber":"123-456-7890", "smsText":"abcd1234="}, {"phon...
Sealey asked 20/8, 2015 at 15:40

1

Detected package version outside of dependency constraint: Microsoft.NET.Sdk.Functions 1.0.13 requires Newtonsoft.Json (= 9.0.1) but version Newtonsoft.Json 10.0.1 was resolved. I am in need of u...
Albertson asked 4/6, 2018 at 10:28

2

Solved

I am working on a .Net 6.0 project, and I want to migrate from Newtonsoft.Json to System.Text.Json. So far most is working, except the following: I've got this json: [ { "Key":"Val...
Cordierite asked 22/11, 2021 at 13:31

8

Solved

I pasted the code from http://www.codeproject.com/Tips/789481/Bridging-the-Gap-between-Linqpad-and-Visual-Studio into Visual Studio 15. It tells me that 'Newtonsoft' could not be found. I open the ...
Garnett asked 4/11, 2016 at 6:27

5

Solved

I have a class with several different classes and I send the information in these classes out to clients but I don't want to send them all out so some are private, some have the [JsonObject(MemberS...
Walkin asked 8/6, 2014 at 14:11

3

Solved

I have a String of json and need convert to JObject. Example: String result = ""{"totalSize":1,"done":true,"records":[{"attributes":{"type":"Municipio__c","url":"/services/data/v37.0/sobjects/Mun...
Sporophyte asked 19/10, 2017 at 12:28

9

Solved

Is it possible to return a dynamic object from a json deserialization using json.net? I would like to do something like this: dynamic jsonResponse = JsonConvert.Deserialize(json); Console.WriteLin...
Folkrock asked 26/12, 2010 at 23:24

5

Solved

I am new to JSON.In my asp.net application i want to parse the json string.So, i have used Newtonsoft.Json package for reading and writing json data.Now, i can able to parse the simple json data.Bu...
Impecunious asked 12/12, 2012 at 12:32

6

Solved

I have two format of JSON which I want to Deserialize to one class. I know we can't apply two [JsonProperty] attribute to one property. Can you please suggest me a way to achieve this? string jso...
Junie asked 1/5, 2017 at 3:55

3

Solved

I'm trying to do a one way transform from F#'s discriminated union to strings upon serialization instead of the default `"Case": [value]". Being able to deserialize the value again is not an issue....
Stagestruck asked 12/11, 2017 at 9:31

3

I have a JsonConverter that, depending on an instance specific flag, needs to either run custom serialization logic run the default Json.NET serialization logic How can the default Json.NET ser...
Durer asked 26/1, 2014 at 16:51

37

Solved

Things I've tried after searching: in Web.Config put a binding on the old version: <dependentAssembly> <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" cultur...
Schaerbeek asked 27/3, 2014 at 10:57

22

Solved

Currently, I have some issues. I'm using C# with Json.NET. The issue is that I always get: {"Unexpected character encountered while parsing value: e. Path '', line 0, position 0."} So t...
Selfabnegation asked 24/4, 2014 at 3:16

6

Solved

I have some JSON that looks like this [ { "MobileSiteContent": { "Culture": "en_au", "Key": [ "NameOfKey1" ] } }, { "PageContent": { "Culture": "en_au", "Page": [ "about-us/" ] } }...
Anthotaxy asked 8/1, 2014 at 17:18

6

Solved

I am working on a Windows Phone 8.1 application involving location. I am receiving Json data from my API. My API returns data that looks like: [{ "country": "India", "city": "Mall Road, Gurgaon"...
Swint asked 9/1, 2016 at 6:45

4

I'm trying to Deserialize object to list of object using JSON.NET lib. My json file is: [ { "id": 1, "name": "Poczta", "description": "Opis", "latitude": 52.25197, "longitude": 20.896355, "a...
Housing asked 18/1, 2015 at 16:58

6

Solved

How can i configure ASP.NET Core Web Api controller to return pretty formatted json for Development enviroment only? By default it returns something like: {"id":1,"code":"4315"} I would like to...
Merkley asked 23/8, 2016 at 11:12

4

Solved

Using C# 9 on .NET 5.0, I have a bunch of record types, like this: public record SomethingHappenedEvent(Guid Id, object TheThing, string WhatHappened) { public SomethingHappenedEvent(object theThi...
Pless asked 19/12, 2020 at 1:47

5

Solved

Consider these two classes: public Class Base { public string Id {get; set;} public string Name {get; set;} public string LastName {get; set;} } And the derived class: public Class Derived :...
Granulation asked 14/9, 2015 at 18:38

2

Solved

I've an object: public class Test { public string Prop1 { get; set; } } I'd like to serialize it to json in a view, so in my cshtml: <script type="text/javascript"> var myJson = JSON.p...
Johanna asked 15/6, 2015 at 12:43

© 2022 - 2024 — McMap. All rights reserved.