When you call the set method of Author, the line is "Author = value", you
are in fact calling the set method of Author again, and then again, etc,
until you get a stack overflow. If you had a member variable
named 'author', then 'author = value' would work. I would expect you would
get a stack overflow calling the get method of Author as well, since
there, you are continuously calling the get method of Author in "return
Author", which is just recursively calling itself over and over...

On Thu, 25 Apr 2002 11:15:29 -0700, Sam Gentile <[EMAIL PROTECTED]>
wrote:

>I'm sorry. I can't figure out from your comment what you mean. I am
>generating the xml file now but it is complaining that it is not well
>formed because it doesn't have a root element. Do I need to do a
>WriteStartDocument and all that? I assumed that XmlSerializer did all
that:
>
>XmlTextWriter xw = new XmlTextWriter("tooldescriptor.xml", null);
>    System.Xml.Serialization.XmlSerializer xs
>= new XmlSerializer( typeof(ToolDescriptor) );
>    xs.Serialize(xw, td);
>
>I also cannot set any of the string properties of my object without
>getting stack overflow on this line:
>td.Author = "Sam Gentile";
>
>which is a property:
>public String Author
>  {
>   get
>   {
>    return Author;
>   }
>   set
>   {
>    Author = value;
>   }
>  }
>
>Any ideas?
>
>You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
>subscribe to other DevelopMentor lists at http://discuss.develop.com.

When you call

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to