Click here to Skip to main content
15,881,709 members
Home / Discussions / C#
   

C#

 
AnswerRe: Retrieving data from a webpage Pin
MAW305-Jan-17 2:30
MAW305-Jan-17 2:30 
QuestionC# Text to Speech Pin
Pavlex42-Jan-17 10:32
Pavlex42-Jan-17 10:32 
AnswerRe: C# Text to Speech Pin
Michael_Davies2-Jan-17 10:38
Michael_Davies2-Jan-17 10:38 
GeneralRe: C# Text to Speech Pin
Pavlex42-Jan-17 10:40
Pavlex42-Jan-17 10:40 
GeneralRe: C# Text to Speech Pin
Pavlex42-Jan-17 11:26
Pavlex42-Jan-17 11:26 
GeneralRe: C# Text to Speech Pin
Pete O'Hanlon2-Jan-17 19:33
mvePete O'Hanlon2-Jan-17 19:33 
GeneralRe: C# Text to Speech Pin
Bernhard Hiller2-Jan-17 21:27
Bernhard Hiller2-Jan-17 21:27 
QuestionXml Serialization of List<T> Pin
Richard Andrew x642-Jan-17 6:18
professionalRichard Andrew x642-Jan-17 6:18 
I have the following code, but the class member "X" refuses to be serialized to the xml file:
C#
[Serializable]
public class MyList : List<MyClass>
{
    public string X = string.empty;
}

protected void Function()
{
    MyList L = new MyList();
    L.X = "String";

    XmlSerializer serializer = new XmlSerializer(typeof(MyList));

    StreamWriter Sw = new StreamWriter(Filename);

    serializer.Serialize(Sw, L);

    Sw.Dispose();
}

The member is simply absent from resulting the Xml file.

Is there anything I can do to force the serializer to serialize member "X" to the file?

Is there some reason it's not serializing "X"? Is it because the class derives from List<T>?



The difficult we do right away...
...the impossible takes slightly longer.

AnswerRe: Xml Serialization of List<T> Pin
Eddy Vluggen2-Jan-17 6:37
professionalEddy Vluggen2-Jan-17 6:37 
GeneralRe: Xml Serialization of List<T> Pin
Richard Andrew x642-Jan-17 8:12
professionalRichard Andrew x642-Jan-17 8:12 
GeneralRe: Xml Serialization of List<T> Pin
Pete O'Hanlon3-Jan-17 4:51
mvePete O'Hanlon3-Jan-17 4:51 
Questionwrite acode Pin
Member 129308832-Jan-17 0:48
Member 129308832-Jan-17 0:48 
AnswerRe: write acode Pin
Jochen Arndt2-Jan-17 0:57
professionalJochen Arndt2-Jan-17 0:57 
AnswerRe: write acode Pin
OriginalGriff2-Jan-17 1:00
mveOriginalGriff2-Jan-17 1:00 
AnswerRe: write acode Pin
Patrice T2-Jan-17 12:45
mvePatrice T2-Jan-17 12:45 
QuestionSentiment Analysis Pin
Member 1287504731-Dec-16 5:13
Member 1287504731-Dec-16 5:13 
AnswerRe: Sentiment Analysis Pin
OriginalGriff31-Dec-16 5:41
mveOriginalGriff31-Dec-16 5:41 
AnswerRe: Sentiment Analysis Pin
Gerry Schmitz31-Dec-16 7:18
mveGerry Schmitz31-Dec-16 7:18 
AnswerRe: Sentiment Analysis Pin
Pete O'Hanlon31-Dec-16 7:38
mvePete O'Hanlon31-Dec-16 7:38 
AnswerRe: Sentiment Analysis Pin
Patrice T1-Jan-17 6:10
mvePatrice T1-Jan-17 6:10 
QuestionScroollbar thumb Y position C# Pin
didielf30-Dec-16 19:57
professionaldidielf30-Dec-16 19:57 
QuestionRe: Scroollbar thumb Y position C# Pin
Richard MacCutchan30-Dec-16 21:03
mveRichard MacCutchan30-Dec-16 21:03 
AnswerRe: Scroollbar thumb Y position C# Pin
didielf30-Dec-16 21:49
professionaldidielf30-Dec-16 21:49 
QuestionRe: Scroollbar thumb Y position C# Pin
Richard MacCutchan30-Dec-16 22:36
mveRichard MacCutchan30-Dec-16 22:36 
AnswerRe: Scroollbar thumb Y position C# Pin
didielf30-Dec-16 22:43
professionaldidielf30-Dec-16 22:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.