You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
JsonConvert.SerializeObject(new TestObject() { Value = "I:\\NanoApp\\NFTestApp1.pe" });
Results in: {"Value":"I:\NanoApp\NFTestApp1.pe"}
But should be: {"Value":"I:\\NanoApp\\NFTestApp1.pe"}
and when deserializing TestObject deserializedTestObject = (TestObject)JsonConvert.DeserializeObject(serializedTestObject, typeof(TestObject));
Results in: Exception:nanoFramework.Json.DeserializationException: Exception was thrown: nanoFramework.Json.DeserializationException
But should be: I:\NanoApp\NFTestApp1.pe
The exception also happens if feeding in the json string of {"Value":"I:\\NanoApp\\NFTestApp1.pe"}
Screenshots
No response
Sample project or code
No response
Aditional information
No response
The text was updated successfully, but these errors were encountered:
Library/API/IoT binding
nanoFramework.Json
Visual Studio version
VS2022 (17.12.2)
.NET nanoFramework extension version
No response
Target name(s)
No response
Firmware version
No response
Device capabilities
No response
Description
nanoFramework.Json.JsonConvert does not properly deserialize the \ character whether an escaped version of string is used or otherwise.
How to reproduce
`public class TestObject
{
public string Value { get; set; }
}
string serializedTestObject = JsonConvert.SerializeObject(new TestObject() { Value = "I:\NanoApp\NFTestApp1.pe" });
TestObject deserializedTestObject = (TestObject)JsonConvert.DeserializeObject(serializedTestObject, typeof(TestObject));`
Expected behaviour
JsonConvert.SerializeObject(new TestObject() { Value = "I:\\NanoApp\\NFTestApp1.pe" });
Results in:
{"Value":"I:\NanoApp\NFTestApp1.pe"}
But should be:
{"Value":"I:\\NanoApp\\NFTestApp1.pe"}
and when deserializing
TestObject deserializedTestObject = (TestObject)JsonConvert.DeserializeObject(serializedTestObject, typeof(TestObject));
Results in: Exception:nanoFramework.Json.DeserializationException: Exception was thrown: nanoFramework.Json.DeserializationException
But should be:
I:\NanoApp\NFTestApp1.pe
The exception also happens if feeding in the json string of
{"Value":"I:\\NanoApp\\NFTestApp1.pe"}
Screenshots
No response
Sample project or code
No response
Aditional information
No response
The text was updated successfully, but these errors were encountered: