зеркало из https://github.com/mono/mail-archives.git
95 строки
3.4 KiB
HTML
95 строки
3.4 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
|
|
<HTML>
|
|
<HEAD>
|
|
<TITLE> [Mono-list] Xml Deserialize + Constructor Needed
|
|
</TITLE>
|
|
<LINK REL="Index" HREF="index.html" >
|
|
<LINK REL="made" HREF="mailto:pablo%40pablo.com.mx">
|
|
<META NAME="robots" CONTENT="index,nofollow">
|
|
|
|
<LINK REL="Previous" HREF="016387.html">
|
|
<LINK REL="Next" HREF="016383.html">
|
|
</HEAD>
|
|
<BODY BGCOLOR="#ffffff">
|
|
<H1>[Mono-list] Xml Deserialize + Constructor Needed
|
|
</H1>
|
|
<B>Pablo Fischer
|
|
</B>
|
|
<A HREF="mailto:pablo%40pablo.com.mx"
|
|
TITLE="[Mono-list] Xml Deserialize + Constructor Needed">pablo@pablo.com.mx
|
|
</A><BR>
|
|
<I>Tue, 14 Oct 2003 11:25:02 -0500</I>
|
|
<P><UL>
|
|
<LI> Previous message: <A HREF="016387.html">[Mono-list] Xml Deserialize + Constructor Needed
|
|
</A></li>
|
|
<LI> Next message: <A HREF="016383.html">[Mono-list] Dispose() method in the UdpClient class
|
|
</A></li>
|
|
<LI> <B>Messages sorted by:</B>
|
|
<a href="date.html#16400">[ date ]</a>
|
|
<a href="thread.html#16400">[ thread ]</a>
|
|
<a href="subject.html#16400">[ subject ]</a>
|
|
<a href="author.html#16400">[ author ]</a>
|
|
</LI>
|
|
</UL>
|
|
<HR>
|
|
<!--beginarticle-->
|
|
<PRE>Thanks! It works!
|
|
|
|
Also thanks to Rafael.
|
|
|
|
Pablo
|
|
El mar, 14-10-2003 a las 03:28, Lluis Sanchez escribió:
|
|
><i> On dt, 2003-10-14 at 06:58, Pablo Fischer wrote:
|
|
</I>><i> > Hi all!
|
|
</I>><i> >
|
|
</I>><i> > I created a file in XML with the help of XmlSerialization, how I want to
|
|
</I>><i> > Deserialize it, I found in may sites (also in msdn) a simple way to do
|
|
</I>><i> > this, so my method:
|
|
</I>><i> >
|
|
</I>><i> > private static void Desarmar() {
|
|
</I>><i> > Accounts accs = new Accounts("test");
|
|
</I>><i> > XmlSerialize mySerializer = new XmlSerializer(typeof(Accounts));
|
|
</I>><i> > FileStream myFileStream = new FileStream(".mbloggyrc", FileMode.Open);
|
|
</I>><i> > accs = (Accounts)mySerializer.Deserialize(myFileStream);
|
|
</I>><i> > }
|
|
</I>><i> >
|
|
</I>><i> > It compiles ok, but when I run it I get:
|
|
</I>><i> >
|
|
</I>><i> > Unhandled Exception: System.MissingMethodException: Default constructor
|
|
</I>><i> > not found
|
|
</I>><i> > (snip)
|
|
</I>><i> > in <0x0009a> .testing:Desarmar ()
|
|
</I>><i> > in <0x0012c> .testing:Main ()
|
|
</I>><i> >
|
|
</I>><i> > A Default Constructor.. for what? I have a Constructor for each
|
|
</I>><i> > element..
|
|
</I>><i>
|
|
</I>><i> A default constructor for Accounts. XmlSerializer will create the
|
|
</I>><i> Accounts instance for you, you don't need to create it yourself.
|
|
</I>><i>
|
|
</I>><i> Lluis.
|
|
</I>><i>
|
|
</I>><i> >
|
|
</I>><i> > Thanks!
|
|
</I>><i> > Pablo
|
|
</I>><i>
|
|
</I>
|
|
|
|
</PRE>
|
|
<!--endarticle-->
|
|
<HR>
|
|
<P><UL>
|
|
<!--threads-->
|
|
<LI> Previous message: <A HREF="016387.html">[Mono-list] Xml Deserialize + Constructor Needed
|
|
</A></li>
|
|
<LI> Next message: <A HREF="016383.html">[Mono-list] Dispose() method in the UdpClient class
|
|
</A></li>
|
|
<LI> <B>Messages sorted by:</B>
|
|
<a href="date.html#16400">[ date ]</a>
|
|
<a href="thread.html#16400">[ thread ]</a>
|
|
<a href="subject.html#16400">[ subject ]</a>
|
|
<a href="author.html#16400">[ author ]</a>
|
|
</LI>
|
|
</UL>
|
|
</body></html>
|