Newtonsoft.Json icon indicating copy to clipboard operation
Newtonsoft.Json copied to clipboard

Exception: Could not load type 'System.Runtime.Serialization.SerializationBinder' while debugging

Open ycherkes opened this issue 2 years ago • 0 comments

I'm facing this exception when trying to serialize an object in the Immediate window of Visual Studio 2022 while debugging.

Steps to reproduce:

  1. Create new .NET6.0 Console application project.
  2. Put the breakpoint on Console.WriteLine.
  3. 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.

ycherkes avatar Aug 08 '22 06:08 ycherkes