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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T21:07:52+00:00 2026-05-27T21:07:52+00:00

Can I control serialization of certain fields using XmlSerializer in c#? Fox example an

  • 0

Can I control serialization of certain fields using XmlSerializer in c#? Fox example an property named “Type”(string) to be serialized as something else instead of string.
Thanks in advance.

  • 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-05-27T21:07:53+00:00Added an answer on May 27, 2026 at 9:07 pm

    You can control a few things via XmlElement / XmlAttribute annotations — the name of the element, whether it is an attribute or full XML element, etc. However, you can’t change the type directly. If you need to support any type of complex serialization scheme, XmlSerializer is not a good choice due to its many limitations. You’re better off using DataContractSerializer (see “Using Data Contracts” in the WCF documentation) or maybe even writing it yourself.

    If you just want to change the XML type of the resulting serialized data (e.g. using a custom XML type or namespace), you can do that with the XmlType attribute, but that will only work for types you have declared and not primitive CLR types (e.g. you can’t make a string into an integer or another more complex type).

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

Sidebar

Related Questions

how can control the width of a select input type? this is my code:
I'm getting the following InvalidOperationException: The parameter conversion from type 'System.String' to type 'System.Runtime.Serialization.ExtensionDataObject'
Is there a way I can control columns from code. I had a drop
I was wondering what settings an application can control to improve battery life in
Can I control the order static objects are being destructed? Is there any way
I can not control the scrolling of a scrollpane from within my actionscript (I
how can i control swf background transparency in vb.net.........either with flash.ocx or if there
How can i control all my forms from main () Form1 frm1 = new
It seems that I can't control the NSApp delegate from within a System Preferences
I have a view user control that can post form. This control can be

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.