I've already wasted a few hours on this one:
XmlSerializer serializer;
YES, the using
is there, the reference is there, I made the entire solution in VS2010 using .NET 4.0 so it's not any of those things. If I go in Object Explorer I can find the XmlSerializer
class I want in the correct namespace but if I try typing the above line in to my code file and compiling I get the dreaded
The type or namespace name 'XmlSerializer' could not be found (are you missing a using directive or an assembly reference?)
warning of death. I don't get it on IntelliSense either. All other threads/websites I've looked on have come up blank or with one of the solutions I've already ruled out. What am I missing? Cheers
XML serialization is the process of converting an object's public properties and fields to a serial format (in this case, XML) for storage or transport. Deserialization re-creates the object in its original state from the XML output.
Yes, you can tell the XmlSerializer to ignore namespaces during de-serialization. Note this is the kind of thing I meant. You are not telling the XmlSerializer to ignore namespaces - you are giving it XML that has no namespaces.
Do you build a Silverlight app?
Silverlight has XmlSerializer
defined inside System.Xml.Serialization.dll
assembly which is not referenced by default.
This often leads to confusion because other framework versions have it defined in System.Xml.dll
.
You need to add System.Xml.Serialization.dll
to project references to wire it up.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With