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

  • Home
  • SEARCH
  • 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 3802606
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T14:14:06+00:00 2026-05-19T14:14:06+00:00

I have generated classes from XSD using the XSD.exe /c command line. Partial classes

  • 0

I have generated classes from XSD using the “XSD.exe /c” command line. Partial classes were generated, so I “completed” them by adding classes with the same name, which allowed me to add additional properties. However, the value of these properties are being included whenever I serialise data back into XML files. Does anyone know how to prevent this, perhaps via an attribute?

Thanks very much,

Nick Hill

  • 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-19T14:14:06+00:00Added an answer on May 19, 2026 at 2:14 pm
    [XmlIgnore]
    public string Foo {get;set;}
    

    actually (for completeness only), you can also do this by two other name-based patterns – you just wouldn’t in this scenario – they are designed for conditionally including data during serialization, and (in the second example) disambiguating between “explicitly deserialized to the default” vs “not in the deserialization source”:

    public bool ShouldSerializeFoo() {return false;}
    

    or

    [XmlIgnore]
    public bool FooSpecified { get { return false;} set {} }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have DataContext classes generated from dbml. Once I get data from the database,
I have a T4 template that generates classes from an xml file. How can
I have a set of XSDs from which I generate data access classes, stored
I have a post-compilation step that manipulates the Java bytecode of generated classes. I'd
We have some code that was generated, mostly likely by svcutil from an XML
i am trying to generate schema using jaxb from my exisitng POJO classes and
I have a generated HTML page with flash content in it. I am trying
I have a generated txt file. This file has certain lines that are superfluous,
I have a PHP-generated page which is displaying some data about a set of
I have long tables generated by datagrid control that go beyond the page width.

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.