473,406 Members | 2,954 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Cannot serialize BuildEventArgs : EventArgs

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
Oct 9 '06 #1
1 2668
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


"Danny" <dN*************@sysNOSPAMMERStemc.comwrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
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

Oct 9 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: MAY | last post by:
Hi, I have a problem about serialize the form controls. I wrote a test program to test serialize a from but fail (->An unhandled exception of type...
2
by: Marcel Balcarek | last post by:
Does anyone have an example of serializing an object to a database table?
2
by: Dave | last post by:
We just started getting this error message in our application today (stack trace below). From the OutOfMemoryException, I'm guessing it could be a memory leak. I'm making sure I'm closing all my...
2
by: Dave | last post by:
I have an application running on a 3 server webfarm running Windows 2003 with SQLServer Session state. After running for several hours, I started getting the following error. When I access each...
5
by: Brad | last post by:
I would like to serialize an arraylist of objects to xml so I can store the xml in a database column. How would I code the serializing and deserializing? Below is a (overly) simple, incomplete...
0
by: Maurice LING | last post by:
Hi, I need to look into serialization for python objects, including codes, recursive types etc etc. Currently, I have no idea exactly what needs to be serialized, so my scope is to be as wide as...
1
by: js | last post by:
Does anybody knows how to solve the problem? I added attribute to the following classes in Microsoft.Practices.EnterpriseLibrary.Data namespace, but I still get the error. Thanks. ...
1
by: Tim | last post by:
Could anyone tell me what this means and how do I correct it. Any suggestions? Thanks! Tim Richardson IT Developer and Consultant www.paladin3d.com Unable to serialize the session state. In...
2
by: Joe | last post by:
If I serialize an object from with the same class, any fields with the NonSerializableAttribute still get serialized but not if I serialize from outside the class. Why? This is a simple case to...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.