I have an utility that modified ASP.NET web.config using code like this:
XmlDocument document = new XmlDocument();
document.Load(sConfigFileName);
XmlNode nodeParent = document.SelectSingleNode("/configuration/system.web");
I found that this code doesn't work with VS 2005 (SelectSingleNode returns null) because configuration element has xmlns
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0"> .
I was able to delete xmlns attribute without any visible side effects to make SelectSingleNode("/configuration/system.web") working .
But it will be probably required to use new classes in Configuration namespace or use XmlNamespaceManager.
I think that Visual XPath source can be a sample for this.
posted @ Thursday, February 02, 2006 1:17 PM