What's the correct namespace and method for serialising an object to xml?

Posted on 2006-05-21
Last Modified: 2010-04-23

I'm trying to use an example of XML serialisation. The cose uses this namespace:

Imports System.Runtime.Serialization.Formatters.Soap

And this code:

  Dim f As New SoapFormatter
  f.Serialize(s, LessonList)

but it gives an error saying 'SoapFormatter' is not defined. Indeed, it isn't in Intellisense under the above namespace.

So what's the correct code?

P.S. I have VB 2005 Express Edition. I hope that doesn't cut me out of the action. Eeck.

Question by:Flying-Kiwi
    LVL 44

    Accepted Solution

    Hi Flying-Kiwi,

    you must reference the System.Runtime.Serialization.Formatters.Soap.dll assembly,
    just add a reference to the project and point to it under .NET dlls on the first tab of the Add Reference dialog

    hope this helps a bit

    Author Comment

    Thx. And today I found out about using XmlSerializer. This serialization stuff blows. What a time saver. Me = Happy Boy. Tra la la la la.
    LVL 44

    Expert Comment

    glad it works great for you,

    the only place i can play with all this new stuff is EE, so my learning curve is bound to questions like yours ;-)

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
    If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    758 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now