public class Hero
{
XPathNavigator Navigator;
XPathDocument HeroInformation;
public string GetHeroIcon(string Name)
{
XDocument HeroInformation = XDocument.Load("InformationRepositories/HeroRepository/HeroInformation.xml");
return HeroInformation.Descendants(Name).Single().Element("Icon").Value;
//return doc.Descendants(name).Single().Element("Icon").Value;
}
}
I get an error in the first line of my method. I don't understand why it's not working when the adress is clearly written correctly. I'm so confused with this.
Here's a picture of my solution explorer: