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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T06:12:54+00:00 2026-05-12T06:12:54+00:00

I have this xml snippet as part of a xml file that will be

  • 0

I have this xml snippet as part of a xml file that will be deserialized to a c# object

<EmailConfiguration>
<SendTo>
    <Address>myEmailAdress@bah.com</Address>
    <Address>also send to</Address>
</SendTo>
<CC>
    <Address>CC</Address>
</CC>
<BCC>
    <Address>BCC</Address>
</BCC>
</EmailConfiguration>

Notice the SendToAddress is a collection of Addresses

<Address>myEmailAddress@bah.com</Address>
<Address>also send to</Address>

My Class currently looks like this

public class SendTo
{
    public string Address
    {
        get;
        set;
    }
}

This is good for 1 address, how do I change the class so that it can handle more than 1 address.

I tried

public class SendTo
{
    public string[] Address
    {
        get;
        set;
    }
}

But with this, nothing gets populated when the xml is deserialized to a class.

Update

tried…also without success….

public class SendTo
{
    public List<string> Address
    {
        get;
        set;
    }
}

Here is the entire class

namespace myConfiguration
   {
public class myConfiguration
{
    private string myID;


    public string MyID
    {
        get { return myID; }
        set { myID = value; }
    }

    public Locale Locale
    {
        get;
        set;
    }

    public EmailConfiguration EmailConfiguration
    {
        get;
        set;
    }

}

public class Locale
{
    public string LocaleName
    {
        get;
        set;
    }
    public string LocaleCode
    {
        get;
        set;
    }
}

public class EmailConfiguration
{
    public SendTo SendTo
    {
        set;
        get;
    }
    public SendTo CC
    {
        set;
        get;
    }
    public SendTo BCC
    {
        set;
        get;
    }
}

public class SendTo
{
    public List<string> Address
    {
        get;
        set;
    }
}

}

Here is the XML that I am deserializing from …

 <?xml version="1.0" encoding="utf-8" ?>
 <MyConfiguration>
 <MyID>vpfaewb</MyID>
 <Locale>
    <LocaleName>cs-CZ</LocaleName>
 <LocaleCode>1029</LocaleCode>
 </Locale>
<EmailConfiguration>
<SendTo>
    <Address>my email address</Address>
    <Address>also send to</Address>
</SendTo>
<CC>
    <Address>CC</Address>
</CC>
<BCC>
    <Address>BCC</Address>
</BCC>
  </EmailConfiguration>
</MyConfiguration>
  • 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-12T06:12:54+00:00Added an answer on May 12, 2026 at 6:12 am

    Try this:

    [XmlArrayItem("Address", IsNullable=false)]
    public string[] SendTo
    {
        get
        {
            return this.sendToField;
        }
        set
        {
            this.sendToField = value;
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an xml snippet that contains an object hierarchy: doc = \ <RootObj
I have this xml file which has text init. i.e Hi my name is
I have this xml file <?xml version=1.0 encoding=UTF-8?> <bo:C837ClaimParent xsi:type=bo:C837ClaimParent xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xmlns:bo=http://somelongpathHere/process/bo> <claimAux> ...
I have this XML at http://localhost/file.xml : <?xml version=1.0 encoding=utf-8?> <val:Root xmlns:val=http://www.hw-group.com/XMLSchema/ste/values.xsd> <Agent> <Version>2.0.3</Version>
Can someone please help me, I have this xml snippet <?xml version=1.0 encoding=utf-8 ?>
I have generated an XSD file from an XML snippet using xsd.exe /out What
I have an snippet XML like this: .... <cell type='1'> <A>Some text</A> </cell> <cell
I have a method that is suppose to edit a xml file: public void
I have this certain method(snippet below) for which I want to get the XML
Let's say I have an XML file such as this: <root> <level1 name=level1A> <level2

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.