1 | initial version |
To export an object while debugging in Visual Studio 2019, follow these steps:
>? System.IO.File.WriteAllText(@"C:\path\to\file.txt", Newtonsoft.Json.JsonConvert.SerializeObject(object));
Replace "C:\path\to\file.txt" with the desired file path and name, and "object" with the name of the object you want to export.Note: This method requires the Newtonsoft.Json package to be installed in the project. You can add it to your project by going to Tools > NuGet Package Manager > Manage NuGet Packages for Solution and searching for "Newtonsoft.Json".