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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T08:59:05+00:00 2026-06-08T08:59:05+00:00

[DataContract] public class AssetData { [DataMember] public string Name { get; set; } [DataMember]

  • 0
[DataContract]
    public class AssetData
    {
        [DataMember]
        public string Name { get; set; }
        [DataMember]
        public List<AssetData> ChildAssets { get; set; }
        [DataMember]
        public int Priority { get; set; }
        [DataMember]
        public AssetData ParentNode { get; set; }
    }

[ServiceKnownType(typeof(Dictionary<string, AssetData>))]
    public interface IRtxEquipmentConfiguration
    {
        [OperationContract] 
        object GetData(string sKey, string sRequest);
    }

For the above OperationContract "GetData" the server is returning a Dictionary of AssetData.
I have marked AssetData as a DataContract and all its fields as DataMembers.
At the client side, I was getting wcf error “The socket connection has been disposed.\r\nObject name: ‘System.ServiceModel.Channels.SocketConnection’.”. I suspected this error is because of the field ChildAssets.
When I disable this field alone (By removing DataMember tag), then at the client side, I was able to get all the Dictionary elements and with in each element all the fields except ChildAssets.
I am able to see remaining fields Name, ParentNode and Priority.

Any clue why WCF fails to serialize a List with in a Dictionary element?

  • 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-08T08:59:07+00:00Added an answer on June 8, 2026 at 8:59 am

    I have fixed the issue by adding IsReference = true to my DataContract class AssetData. The object graph has references to other instances of AssetData class. ChildAssets members are just references to other instances of AssetData.

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

Sidebar

Related Questions

[DataContract] public class Foo { [DataMember(Order = 1)] public int FooId { get; set;
[DataContract] public class SearchResults { [DataMember] public List<SearchDetail> PList { get; set; } [DataMemberAttribute]
[DataContract] public class I<TId> { [DataMember(Order = 1)] public TId Id { get; set;
I am having trouble when using List objects: [DataContract] public class Recipe { [DataMember(Name=Allergies)]
The case is: [ServiceContract] public interface IInfo { [DataMember] int Id{get;set;} } [DataContract] [KnownType(typeof(Legal))]
I have a class: [DataContract] public class Result { [DataMember] public String Log {get;
Given a class: [DataContract] public sealed class ChangedField { [DataMember(Name=I)] public ushort FieldId {
I have the following DTO definition:- [DataContract] public class AddProductDTO { [DataMember] public string
I have a simple data contract: [DataContract] public class MyData { [DataMember] public string
Given these types: [DataContract] public class EntityId { [DataMember(Order = 1)] public string IdAsString

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.