I'm trying to learn some Linq to XML stuff, and I came across the XPathSelectElement function in XElement. This function seems to do just what I need, but for some reason, I can't use it! Check out my code:
XElement rootElement = XElement.Load(dataFile);
XElement parentElement = rootElement.XPathSelectElement(xPath);
I have included references to System.Xml.Linq everywhere that is needed. All the other stuff in that library that I have tried appears to be working, but XPathSelectElement doesn't even appear in the Intellisense in visual studio.
When building the above code, I get the following error:
Error 1 'System.Xml.Linq.XElement' does not contain a definition for 'XPathSelectElement' and no extension method 'XPathSelectElement' accepting a first argument of type 'System.Xml.Linq.XElement' could be found (are you missing a using directive or an assembly reference?) C:\PageHelpControl\PageHelp.cs 155 50 HelpControl