Skip to content

Instantly share code, notes, and snippets.

@ArthurHNL
Created October 28, 2019 11:07
Show Gist options
  • Save ArthurHNL/41c62179143562cf2a9a3ec328f08c3d to your computer and use it in GitHub Desktop.
Save ArthurHNL/41c62179143562cf2a9a3ec328f08c3d to your computer and use it in GitHub Desktop.
Paste this in the immediate window of VS during a debugging session of a C# project to immideatly serialize an object to JSON. For this to work, Newtonsoft.Json must be present in the current AppDomain.
global::System.IO.File.WriteAllText("temp.json", global::Newtonsoft.Json.JsonConvert.SerializeObject(variableName));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment