Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / CLR / February 2004

Tip: Looking for answers? Try searching our database.

XmlSerializer.Serialize

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
- 10 Nov 2003 12:50 GMT
Hey,

 I have made a method that would take any object o and an array of
extraTypes to construct a XmlSerializer object then call .Serialize(stream,
object)...  When I have this called within the same method as the type it
works fine but when I am passing this type and the extra types array Its got
the subtypes but its not generating the XML.

 I am passing in ob.GetType(), and xtraTypes as the constructor parameters
to XmlSerializer(..)

 According to the debugger it has the type, the data and subtypes ok, its
just not serializing it to XML properely.

Is this odd behaviour of the Serializer?
Nicholas Paldino [.NET/C# MVP] - 10 Nov 2003 14:08 GMT
   Can you give a small example?  Is there an error?

Signature

              - Nicholas Paldino [.NET/C# MVP]
              - mvp@spam.guard.caspershouse.com

> Hey,
>
[quoted text clipped - 11 lines]
>
> Is this odd behaviour of the Serializer?
- 10 Nov 2003 14:22 GMT
There is no error reported. I just have the usual serializer call with the
object.GetType() in the first parameter and the extra types for the array of
objects , it works fine in the inline but as a generalized method its not
serializing the array of types.

 I am passing in to the generaliezd one as generalSerializer(object o,
Type[] t) and passing  in o.GetType(), and t[0] = someType.GetType();  I
even tried typeof(blah.blah) and same result.

>     Can you give a small example?  Is there an error?
>
[quoted text clipped - 16 lines]
> >
> > Is this odd behaviour of the Serializer?
"Matt Tavis [MSFT]" - 13 Feb 2004 01:32 GMT
Can you provide a simple repro that shows this?  

Thanks.

Matt Tavis

Program Manager
XML Web Services
Microsoft Corporation

--------------------
>>From: <discussion@discussion.microsoft.com>
>>References: <#HMUUi4pDHA.2404@TK2MSFTNGP12.phx.gbl>
<OswMXR5pDHA.1928@TK2MSFTNGP12.phx.gbl>
>>Subject: Re: XmlSerializer.Serialize
>>Date: Mon, 10 Nov 2003 15:22:57 +0100
[quoted text clipped - 5 lines]
>>Message-ID: <ehNrCW5pDHA.3180@TK2MSFTNGP11.phx.gbl>
>>Newsgroups:
microsoft.public.dotnet.framework,microsoft.public.dotnet.framework.clr,micr
osoft.public.dotnet.general,microsoft.public.dotnet.languages.csharp,microso
ft.public.vsnet.debugging
>>NNTP-Posting-Host: h97n3c1o1031.bredband.skanova.com 213.65.34.97
>>Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP11.phx.gbl
>>Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.clr:8664
microsoft.public.dotnet.general:115123
microsoft.public.dotnet.languages.csharp:198033
microsoft.public.vsnet.debugging:4106
microsoft.public.dotnet.framework:58428
>>X-Tomcat-NG: microsoft.public.dotnet.framework.clr
>>
[quoted text clipped - 31 lines]
>>> >
>>> > Is this odd behaviour of the Serializer?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.