|
-
Mar 31st, 2005, 11:45 AM
#1
Thread Starter
Frenzied Member
Last edited by TomGibbons; Mar 31st, 2005 at 12:49 PM.
-
Mar 31st, 2005, 12:21 PM
#2
Thread Starter
Frenzied Member
Re: Serialized XML Classes - InvalidOperationException
Well I got it to work fine by removing all of the [XmlRoot] and [XmlAttribute] bits. But I shan't mark this as resolved because I'd stil like to know what was causing the original problem
-
Mar 31st, 2005, 12:23 PM
#3
Re: Serialized XML Classes - InvalidOperationException
You're not going to be happy
In XmlList.cs:
Code:
public class List
{
[XmlAttribute("item1")] public string Item1;
[XmlAttribute("item1")] public string Item2;
public List()
{
}
public List(string Item1, string Item2)
{
this.Item1 = Item1;
this.Item2 = Item2;
}
}
-
Mar 31st, 2005, 12:25 PM
#4
Thread Starter
Frenzied Member
Re: Serialized XML Classes - InvalidOperationException
I've removed the XmlAttribute bits from there too...
-
Mar 31st, 2005, 12:38 PM
#5
Re: Serialized XML Classes - InvalidOperationException
 Originally Posted by TomGibbons
I've removed the XmlAttribute bits from there too...
Sorry, should've been a little clearer The problem was that you had two elements exposed with the same name "item1"; thus no need to remove the XML serialisation attributes, just replace with the following:
Code:
[XmlAttribute("item1")] public string Item1;
[XmlAttribute("item2")] public string Item2;
-
Mar 31st, 2005, 12:40 PM
#6
Thread Starter
Frenzied Member
Re: Serialized XML Classes - InvalidOperationException
ooooooooooooh Christ almighty you're right. I can't believe I didn't see that. Thank you!
-
Mar 31st, 2005, 12:54 PM
#7
Re: Serialized XML Classes - InvalidOperationException
 Originally Posted by TomGibbons
ooooooooooooh Christ almighty you're right. I can't believe I didn't see that. Thank you! 
np
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|