A
Andrew Chalk
I am parsing my ASP.NET 2.0 web apps. web.config file. The following line
produces xnl with 0 elements
XmlNodeList xnl = xd.SelectNodes("/configuration/appSettings/add");
if web. config has:
<?xml version="1.0"?>
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<appSettings>
<add key="ErrorLogDirectory"
value="D:\WORK\Logger\CallView\20070508\bin" />
</appSettings>
....
However, it produces xnl with 1 element (the correct number) if I modify
web.config as follows:
<?xml version="1.0"?>
<configuration>
<appSettings>
<add key="ErrorLogDirectory"
value="D:\WORK\Logger\CallView\20070508\bin" />
</appSettings>
....
I.e. xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0" is deleted.
How can I get XmlNodeList to return the correct number of elements with the
former web.config syntax?
Many thanks.
produces xnl with 0 elements
XmlNodeList xnl = xd.SelectNodes("/configuration/appSettings/add");
if web. config has:
<?xml version="1.0"?>
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<appSettings>
<add key="ErrorLogDirectory"
value="D:\WORK\Logger\CallView\20070508\bin" />
</appSettings>
....
However, it produces xnl with 1 element (the correct number) if I modify
web.config as follows:
<?xml version="1.0"?>
<configuration>
<appSettings>
<add key="ErrorLogDirectory"
value="D:\WORK\Logger\CallView\20070508\bin" />
</appSettings>
....
I.e. xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0" is deleted.
How can I get XmlNodeList to return the correct number of elements with the
former web.config syntax?
Many thanks.