Skip to main content
Improve readability
Source Link

{none} is not valid JSON., but 'none' is valid!

You should try the following:

public class Program { public static void Main() { Console.WriteLine("Hello World"); var jsonString = "'none'"; var deserializedObject = JsonConvert.DeserializeObject<TestEnum>(jsonString); Console.WriteLine(deserializedObject); } } 

Cheers!

{none} is not valid JSON.

You should try the following:

public class Program { public static void Main() { Console.WriteLine("Hello World"); var jsonString = "'none'"; var deserializedObject = JsonConvert.DeserializeObject<TestEnum>(jsonString); Console.WriteLine(deserializedObject); } } 

Cheers!

{none} is not valid JSON, but 'none' is valid!

You should try the following:

public class Program { public static void Main() { Console.WriteLine("Hello World"); var jsonString = "'none'"; var deserializedObject = JsonConvert.DeserializeObject<TestEnum>(jsonString); Console.WriteLine(deserializedObject); } } 

Cheers!

Source Link

{none} is not valid JSON.

You should try the following:

public class Program { public static void Main() { Console.WriteLine("Hello World"); var jsonString = "'none'"; var deserializedObject = JsonConvert.DeserializeObject<TestEnum>(jsonString); Console.WriteLine(deserializedObject); } } 

Cheers!