I am using Json.Net to serialize XML into JSON. When I write the serialized string to a file it all comes in a single line. How do I get it to actually look like Json with the usual tabs and indentation?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Set the JSON writer
Formattingproperty toFormatting.Indented:The
JsonConvert.Serialize*methods also have overloads that take aFormattingenum (thanks John Flatness).Documentation: Serialize an Object