Newtonsoft.Json
Newtonsoft.Json copied to clipboard
Exception: Could not load type 'System.Runtime.Serialization.SerializationBinder' while debugging
I'm facing this exception when trying to serialize an object in the Immediate window of Visual Studio 2022 while debugging.
Steps to reproduce:
- Create new .NET6.0 Console application project.
- Put the breakpoint on Console.WriteLine.
- When the debugger hits the breakpoint, execute the following statements in the immediate window:
a.
System.Reflection.Assembly.LoadFrom(@"C:\Temp\Newtonsoft.Json\netstandard2.0\Newtonsoft.Json.dll")
b.Newtonsoft.Json.JsonConvert.SerializeObject(new[] { 1, 2, 3 })
Actual Result: Newtonsoft.Json throws an exception Expected result: VS prints the serialized object.
The netstandard1.0 and netstandard1.3 versions of Newtonsoft.Json are working with no issues.