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 927795
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T19:54:32+00:00 2026-05-15T19:54:32+00:00

I need to XML serialize some classes, which in some cases do not adhere

  • 0

I need to XML serialize some classes, which in some cases do not adhere to the rules and guidelines, that is needed in order to make built-in serialization work. This includes properties that are interface types and properties without setters.

I know how to implement IXmlSerializable, but it could be a lot of work; since most of the properties will need no special handling. Is there any way for me to only write code to handle these “special properties” and have the standard XML serializer serialize the properties that it knows how to serialize ?

Also, suggestions for open source libraries or similar, that can do a better job at serializing the objects to XML without too much custom code, is welcomed.

  • 1 1 Answer
  • 1 View
  • 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-05-15T19:54:32+00:00Added an answer on May 15, 2026 at 7:54 pm

    There is a tool called Automapper This tool maps two types to each other. For your problem you could build a standard conform type and map the not standard one to this one. Most of the properties will be mapped with the automapper. Special ones you could map with your own methods.

    First you have to setup your mappings:

    Mapper.CreateMap<ITestSequence, TestSequence>();
    Mapper.CreateMap<ITestBlock, TestBlock>();
    

    And then map your opjects:

    Mapper.Map(srcTb, dstTb);
    

    which will set all common properties. The rest you could do by yourself.

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

Sidebar

Related Questions

I am working on some classes which I need to serialize/deserialize to xml, that
I have a business class which I need to serialize to xml. It has
HI, i need a XML parser. i want to know that which one is
i need help, i have some data coming in xml, i want to make
I have an object graph that I need to serialize to xml and save
I have a class that I need to do some custom XML output from,
I have some Xml that I need to deserialize into an object. The Xml
I need to read and serialize objects from and to XML, Apple's .plist format
I need an XML-serializable dictionary. Actually, I now have two quite different programs that
I need to edit XML files on a small Linux box that we have

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.