I’m trying to serialize into a Xml File an object which is declared as ILIst, but it’s an instance of List. The exception tells me the reason: You can’t serialize an interface.
This is really necessary in my design, or what other way do I have to serialize it?
I suppose the reason you need to keep the design with IList is because it’s a common interface to other module. One possible solution:
Instead of:
You can probably try:
This way you can keep the same interface, and meanwhile take advantage of serialize/deserialize functionality in .Net Xml library.