Finally I was able to resolve this one, all of my DTO (XSD) were an extension of same parent class by the name BaseType. I had to add a public field with XmlNamespaceDeclarations decoration, this field is consulted right before serialization.
#region Public Fields
/// <summary>
/// This is considered at the time of serialization for adding namespace prefixes,
/// The namespaces are built in the default constructor, it queries a Constant that in chance fetches the namespace(s) from configuration file
/// </summary>
[XmlNamespaceDeclarations]
public XmlSerializerNamespaces Prefixes;
#endregion
#region Public Constructors
/// <summary>
/// Builds namespace prefixes for serialization
/// </summary>
public BaseType()
{
Prefixes = new XmlSerializerNamespaces();
int index = 1;
Constants.NAMESPACES
.ForEach(tempNamespace =>
Prefixes.Add(Constants.PREFIX_LETTER + index++, tempNamespace)
);
}
#endregion
I hope this one helps somebody.
Cheers,
Avi