Danke, das wäre es gewesen! - Nur leider funktioniert das anscheinend nur gut mit primitiven Objekttypen und dem Vorhandensein von parameterlosen Konstruktoren. Da ich aber Collections und komplexe Objekttypen mit Konstruktoren mit Pflichtparametern verwende, bleibt mir nur die Möglichkeit, die Einstellungen selbst an die XML-Datei zu übergeben, oder eine eigene Einstellungs-Klasse zu erstellen, welche mit primitiven Typen auskommt...
Zitat:
Zitat von http://msdn.microsoft.com/en-us/library/ms950721.aspx
Q: How do I serialize collections of objects?
A: The XmlSerializer throws an exception when the collection contains types that were not declared to the constructor of the XmlSerializer. You can:
- Declare the types to the serializer by passing in a Type[] with the types to expect within the collection. OR
- Implement a strongly-typed collection derived from System.Collections.CollectionBase with an indexer matching the Add() method.
|