Formatter

  • Thread starter Patrick De Ridder
  • Start date
P

Patrick De Ridder

Which library should I include for the formatter in

formatter.Serialize(output, record);

Many thanks.
 
D

David Nelson

using System.Runtime.Serialization;

using System.Runtime.Serialization.Formatters.Binary;

dont think you need to reference any .dll's other then the defaults.

but i could be wrong! :)

regards

Dave
 
J

Jay B. Harlow [MVP - Outlook]

Patrick,
What type of object is formatter defined to be? ;-)

For the Binary formatter look for the
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter

For the XML formatter look for the
System.Runtime.Serialization.Formatters.Soap.SoapFormatter

Both of which implement the
System.Runtime.Remoting.Messaging.IRemotingFormatter &
System.Runtime.Serialization.IFormatter interfaces.

There is also System.Runtime.Serialization.Formatter base class, which I
believe is used by the BinaryFormatter & SoapFormatter, but I'm not sure
how. The help for Formatter says "Provides base functionality for the common
language runtime serialization formatters", But BinaryFormatter &
SoapFormatter do not appear to inherit from Formatter... But I digress...
;-)

Hope this helps
Jay
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top