Could someone point out to me which directory I should be using to work with keywords such as ‘From’ ‘select’ and ‘where’ for LINQ?
I’m trying to do this:
var document = XDocument.Load(workingDir + @"\Moduleslist.xml");
var items = From d in document.Descendants("Name")
select d.Value;
But its giving me errors on ‘From’ and ‘select’ ‘Value’ and ‘Descendants’. I’ve tried importing System.Xml.Linq; and System.Linq; but none allow me to use these keywords. Does anybody know how to fix this?
You should use
frominstead ofFrom