Just recently I have been studying for my MCTS foundation exam and as part of this I had created a windows for application for calculating golf scores. As part of this application I was storing the information in a generic list of a custom Person class. I decided to extend the functionality by allowing the user to export and import the information and thought it would be an ideally opportunity to practice serialization.

 

At first I was using a binary formatter and everything worked fine, however I decided to try using the SoapFormatter instead. I changed the code to use SoapFormatter and expected everything would just work as I had test it using the binary formatter but when I ran the program I got an error saying

 

"Soap Serializer does not support serializing Generic Types : System.Collections.Generic.List`1[GolfScores.Person]."

 

After spending some time researching the problem I found an interesting discussion on the MSDN forum about this error, http://forums.msdn.microsoft.com/en-US/netfxremoting/thread/ee4a7a63-290e-432f-bd45-44f4cb7a3467/.

 

Apparently there are ways around this but for the purposes of my golf application I was able to use the XmlSerializer. Most people use generics these days so its something to consider when you are looking to use the to serialize information stored in a generic list.


Bookmark with :
Digg It! DZone StumbleUpon Technorati Reddit Del.icio.us Newsvine Furl Blinklist
posted @ Wednesday, July 02, 2008 11:22 AM |

Comments

No comments posted yet.

Post Comment

Title *
Name *
Email
Url
Comment *  


Please add 5 and 4 and type the answer here: