tags:

views:

51

answers:

1

While adding a node into web.config file dynamically, I'm getting an extra, unwanted attribute
xmlns=""

how can I solve it?

A: 

It depends on how you are generating the web.config.

If you are using XmlSerialization you need to create an XmlSerializerNamespace and pass that in when you do the serialization.

XmlSerializerNamespaces ns = new XmlSerializerNamespaces();
ns.Add("", "");
xmlSerializer.Serialize(stream, myObject, ns);

If you are editing the code in another manner there will be a different answer.

sirchristian