I am currently using Xml Serialization to serialize my classes in Visual Studio 2010, but I have been unable to remove the default namespaces that get attached to my document.
These two elements get attached to the root of my document each time.
When I specify my XmlRoot attribute on my class, I have tried both methods:
as well as
Both of these methods have continued to result in the namespace being appended to my XmlDocument.
This is currently the method I have been calling for my Xml Serialization:
<pre lang="x-c#">/// <summary>
/// Performs XmlSerialization of a particular object/class
/// using the .Net Xml Serializer
/// <param name="objForSerialization">object or class instance to be serialized</param>
/// <returns>string containing the serialized object in Xml Document format</returns>
public static string XmlSerialize(object objForSerialization)
string strSerialized = string.Empty;
using (MemoryStream memoryStream = new MemoryStream())
XmlSerializer serializer = new XmlSerializer(objFo
View Complete Post