Click here to Skip to main content
15,891,704 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,
i am loading a Web.Config into a XmlDocument. It is successfully read.
System.Xml.XmlElement Root = xmlDocument.DocumentElement;
                System.Xml.XmlNode node = Root.SelectSingleNode("//appSettings/add[@key='ipAdresseWebServer']");


after that, "Root" has the value "configuration" which is right, but "node" always stays "null" :/
I just can't find the problem.
Greetings Tobi
Posted

This tells me there's something wrong with your parameter.
 
Share this answer
 
Thats right, he doesn't find the node.
The XML looks like this:
<   ?xml version="1.0"?>
 <  configuration      xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
  <   appsettings>
   < add key="ipAdresseWebServer" value="XXX.XXX.XXX.XXX:XX" />
  <   /appsettings>
 <  /configuration>


So whats wrong?
 
Share this answer
 
v4
XML is case sensitive. (appsettings vs. appSettings)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900