Cannot serialize BuildEventArgs : EventArgs

D

Danny

Am trying to XML serialize a BuildEventArgs (used for msbuild stuff) object
but I don't get any xml outputted! just a header.The docs say I should be
able to serialize the class[SerializableAttribute]
public abstract class BuildEventArgs : EventArgsExample:BuildErrorEventArgs
test = new BuildErrorEventArgs("asdf", "a", "d", 33, 324, 45345, 111, "msg",
"Help", "sender");XmlSerializer s = new
XmlSerializer(typeof(BuildErrorEventArgs), "test");Stream fs = new
FileStream(@"c:\logger.xml", FileMode.Create);XmlWriter writer = new
XmlTextWriter(fs, Encoding.Unicode);s.Serialize(writer,
test);writer.Close();Thanksdan
 
D

Danny

And now for something a little more readable...

Am trying to XML serialize a BuildEventArgs (used for msbuild stuff) object
but I don't get any xml outputted! just a header.

The docs say I should be
able to serialize the class
[SerializableAttribute]
public abstract class BuildEventArgs : EventArgsExample:

BuildErrorEventArgs test = new BuildErrorEventArgs("asdf", "a", "d", 33,
324, 45345, 111, "msg", > "Help", "sender");
XmlSerializer s = new >XmlSerializer(typeof(BuildErrorEventArgs), "test");
Stream fs = new FileStream(@"c:\logger.xml", FileMode.Create);
XmlWriter writer = new XmlTextWriter(fs, Encoding.Unicode);
s.Serialize(writer, test);
writer.Close();

Thanks
dan
 

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