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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T11:06:24+00:00 2026-06-11T11:06:24+00:00

I am using XMLSerialization to pass data from a client based Win7 application to

  • 0

I am using XMLSerialization to pass data from a client based Win7 application to our server (Server 2008 R2) via a Pipe communication process. I have been brought into this project to finish the previous developer’s efforts who abandoned it … therefore I am presently trying to fix the C# code in VS2010 that doesn’t work.

The problem is that I cannot obtain full serialization of the resulting output from the following method which is in “public partial class Test”. We have a table defined in the MS Compact Server database (named “Test”) which matches each item below and has a FK to the “Channel” table, based on matching TestID’s in both tables. EntityCollection is based on its relationship to the “Channel” table:

public Test(Guid TestID, String TestName, String TestRemarks, String ScriptPath,
            EntityCollection<Channel> TChannels)
{
    ID = TestID;
    Name = TestName;
    Remarks = TestRemarks;
    Path = ScriptPath;
    Channels = TChannels;
}

Here is a sample of how it is used in the execution of the method:

Test T = new Test(NewID, "Test1", "Test_120912-1729",
            "C:\\Temp\\TestScript_16.txt", TChannels);

Here is the result of the serialization process:

<DataCore xsi:type="Test">
  <ID>bc6a8ef7-c31f-404d-8108-86219d45be63</ID>
  <Name>Test1</Name>
  <Remarks>Test_120912-1729</Remarks>
  <Path>C:\Temp\TestScript_16.txt</Path>
</DataCore>

The first four parameters serialize fine, but the last one (the EntityCollection) is failing to do so. However, if I try to serialize “TChannels” by itself (outside the “Test” function) the serialization of each Test Channel works perfectly. I don’t fully understand the limitations/requirements for utilizing XMLserialization to solve this problem. Why am I unable to serialize the EntityCollection< > from within the function?

Thanks for your assistance!

  • 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-11T11:06:25+00:00Added an answer on June 11, 2026 at 11:06 am

    I finally found a solution to the above problem. While the many suggestions were appreciated, none of them provided a solution to my inability to XmlSerialize a child EntityCollection. I dug deeper and looked into the ADO.NET Framework and found within the auto generated code in my database Model.Designer.cs file, an [XmlIgnoreAttribute()] near the beginning of Navigation Properties in my Test (EdmEntityTypeAttribute).

    I simply removed the [XmlIgnoreAttribute()] line completely and now all the child objects of “Channels” from the EntityCollection<> are Serialized properly. I hope this can help others who are also unable to Serialize child objects.

    Thanks @Dave R.

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

Sidebar

Related Questions

Using SQL Server 2008 R2 we are looking for a way to select the
For my application, I need to serialize data to file using XML, so I
A LinkedList can't be serialized using XmlSerializer. Now, how to however save/retrieve data from
I have a server-client application in which I can modify both codebases. The client
I'm using XML Serialization heavily in a web service (the contracts pass complex types
My client is required to pass the Url to my WSDL web service. They
I created an .xsd from an xml file using XSD.Exe from the Visual Studio
Is there a possibility to use xmlwriter (xmlserialization) without managed code (cli)? using namespace
I am using xml-serialization in my project to serialize and deserialize objects based on
I want to save an XML file using XML serialization on the server and

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.