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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T09:42:14+00:00 2026-05-25T09:42:14+00:00

I have a base class with a few properties: // must include any derived

  • 0

I have a base class with a few properties:

    // must include any derived classes here as known types or else they will throw errors on serialization
[KnownType(typeof(CollaborationEventMeasureDistance))]
[DataContract]
public partial class CollaborationEvent
{
    public bool HasBeenTransported { get; set; }
    public Guid MessageBoxGuid { get; set; } 

    public CollaborationEvent()
    {
        HasBeenTransported = false;
    }

}

And a derived class with some properties of its own:

    public class CollaborationEventMeasureDistance : CollaborationEvent
{
    public Geometry Geometry { get; set; }
}

When I serialize the derived class, all of its properties are serialized, but the properties it inherits from the base class are not:

<CollaborationEvent i:type="CollaborationEventMeasureDistance">
  <Geometry xmlns:d4p1="http://schemas.datacontract.org/2004/07/ESRI.ArcGIS.Client.Geometry"
  i:type="d4p1:Polyline">
    <d4p1:spatialReference>
      <d4p1:wkid>26910</d4p1:wkid>
    </d4p1:spatialReference>
    <d4p1:paths>
      <d4p1:points>
        <d4p1:point>
          <d4p1:spatialReference>
            <d4p1:wkid>26910</d4p1:wkid>
          </d4p1:spatialReference>
          <d4p1:x>460892.23924271885</d4p1:x>
          <d4p1:y>5367682.5572773879</d4p1:y>
        </d4p1:point>
        <d4p1:point>
          <d4p1:spatialReference i:nil="true" />
          <d4p1:x>461001.35841108358</d4p1:x>
          <d4p1:y>5367648.5755294543</d4p1:y>
        </d4p1:point>
      </d4p1:points>
    </d4p1:paths>
  </Geometry>
</CollaborationEvent>

Can anyone point out what I am doing wrong?

I expect my XML to look more like:

    <CollaborationEvent i:type="CollaborationEventMeasureDistance">
  <HasBeenTransported>True</HasBeenTransported>
  <MessageBoxGuid>blah</MessageBoxGuid>
  <Geometry xmlns:d4p1="http://schemas.datacontract.org/2004/07/ESRI.ArcGIS.Client.Geometry"
  i:type="d4p1:Polyline">
    <d4p1:spatialReference>
      <d4p1:wkid>26910</d4p1:wkid>
    </d4p1:spatialReference>
    <d4p1:paths>
      <d4p1:points>
        <d4p1:point>
          <d4p1:spatialReference>
            <d4p1:wkid>26910</d4p1:wkid>
          </d4p1:spatialReference>
          <d4p1:x>460892.23924271885</d4p1:x>
          <d4p1:y>5367682.5572773879</d4p1:y>
        </d4p1:point>
        <d4p1:point>
          <d4p1:spatialReference i:nil="true" />
          <d4p1:x>461001.35841108358</d4p1:x>
          <d4p1:y>5367648.5755294543</d4p1:y>
        </d4p1:point>
      </d4p1:points>
    </d4p1:paths>
  </Geometry>
</CollaborationEvent>

Thanks

  • 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-25T09:42:15+00:00Added an answer on May 25, 2026 at 9:42 am

    Assuming your Geometry class is serializable, try something like this:

    [DataContract, Serializable]
    public class CollaborationEventMeasureDistance : CollaborationEvent  
    {  
        [DataMember]
        public Geometry Geometry { get; set; }  
    } 
    
    [KnownType(typeof(CollaborationEventMeasureDistance))] 
    [DataContract, Serializable]
    public partial class CollaborationEvent 
    { 
        [DataMember]
        public bool HasBeenTransported { get; set; } 
        [DataMember]
        public Guid MessageBoxGuid { get; set; }  
    
        public CollaborationEvent() 
        { 
            HasBeenTransported = false; 
        } 
    
    } 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have base class BaseClass and derived classes DerivedA , DerivedB , and DerivedC
I have a base class, FooBase. On it are a few standard read/write properties.
Please could someone advise? We have an abstract base class with a few properties
Let's say I have a few classes Class Alpha (Base Class) Class Beta (Subclass
I have a base class vehicle and some children classes like car, motorbike etc..
In C#, I have a class hierarchy with a couple of abstract base classes
In my project I have a few functions in derived classes that are the
I have a base class and a derived class both in design phase. The
I have an interface with several events I have base class implementing the interface
I have a base class object array into which I have typecasted many different

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.