The XML serialisation process injects default namespaces into the generated XML:
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
These can be supressed in the XmlSerializer by explicitly passing in an XmlSerializerNamespaces object to the Serialize method.
I would be happy to develop a fix for this and submit a pull request if the team feel it is useful.
Comments: With all the posts and people searching on how to do this I'd hardly call it harmless. Obviously it causes a lot of issues for people. Suppressing it should be a lot easier that having to right custom serializers. I find myself having to remove it a lot more than needing it there.
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
These can be supressed in the XmlSerializer by explicitly passing in an XmlSerializerNamespaces object to the Serialize method.
I would be happy to develop a fix for this and submit a pull request if the team feel it is useful.
Comments: With all the posts and people searching on how to do this I'd hardly call it harmless. Obviously it causes a lot of issues for people. Suppressing it should be a lot easier that having to right custom serializers. I find myself having to remove it a lot more than needing it there.