• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 200
  • Last Modified:

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


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.

  • 2
1 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
Flying-KiwiAuthor Commented:
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.
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 ;-)

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now