skip to Main Content

Why does json.NET give “Additional text encountered after finished reading JSON content”?

I'm trying to deserialize a JSON object. The value of the string 'plaintext' is: {"expiryDay":1,"expiryMonth":6,"expiryYear":2023,"machineGuid":"a3586fb9-b05e-46f1-a4a0-683a97109e34","name":"Alexander Farley"} This line throws an exception: var json = JObject.Parse(plaintext); The exception is: Newtonsoft.Json.JsonReaderException: 'Additional text encountered after finished reading JSON content: . Path '',…

VIEW QUESTION

Json – How to create a c# object and serialize it

In C# I want to created JSON String or Object with the format below: { "retailer_br_id" : "5473182", "retailer_external_id": "", "erp_invoice_number" : "INV-202302", "invoice_date": "2023-04-06T17:00:00.000Z", "status" : 1, "details":[{ "sku_external_id": "TD5015151432201", "quantity" : "2", "price_per_item": "14.5" }, { "sku_external_id": "000005020170898446",…

VIEW QUESTION
Back To Top
Search