Click here to Skip to main content
14,972,912 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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

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

So whats wrong?
XML is case sensitive. (appsettings vs. appSettings)

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