Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7721835
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T04:01:45+00:00 2026-06-01T04:01:45+00:00

When working with JSON, I can use NuGet to add JSON.Net and this allows

  • 0

When working with JSON, I can use NuGet to add JSON.Net and this allows me to create a class containing the elements of my JSON object and serialise this to a JSON string. This seems to work better than using String.Format(""); to just manually create the JSON.

For XML, I currently use XDocument to create any XML documents I need to. This works but it is quite a manual process which gets messy as the document gets larger. It is also difficult to maintain when I need to go back later and add to the document.

I have a hunch that I find this difficult and messy because I’m doing it wrong. I am creating my XML documents using functional concepts but am working with an Object Oriented language. Surely what I need to do is create an class and implement properties and a constructor to create an object with the same properties as the XML document, then use some sort of framework to serialise this to a string?

So my question is how do I serialise a class to XML using Visual Studio 2010 and C#?

Cheers

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T04:01:47+00:00Added an answer on June 1, 2026 at 4:01 am

    You can create a simply C# class with the needed properties and decorate it with the different Data* attributes from the System.Runtime.Serisalization namespace then use the DataContractSerializer to produce the XML.

    See Using Data Contracts on MSDN and the example on the DataContractSerializer page.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working in Eclipse. I want to use JSON object in my servlets,
I'm working on creating a JsonConverter for JSON.NET that is capable of serializing and
How can I use the callback function properly cause it's not working. I want
This is the json file I am working with ?( { title:1, description:description, site:site,
I'm working on a Rails 3.2.2 application which has JSON APIs and I use
I am working with JSON. when I am Passing data for serialization at that
i am working with JSON to send data to and from my server ,
I'm working on a JSON API and I want to do something like Facebook's
I am working with learning json right now and to get my feat wet
I have been working on a json decode issue (which I have already had

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.