I'm reading an xml file and want to make it from a relative directory based on the location of the application, similar to ASP.NET with Server.MapPath or using the tilda.
How can you get the relative path in WPF?
WORKS: XDocument xmlDoc = XDocument.Load(@"c:\testdata\customers.xml");
DOES NOT WORK: XDocument xmlDoc = XDocument.Load(@"~\Data\customers.xml");
DOES NOT WORK: XDocument xmlDoc = XDocument.Load(@"~/Data/customers.xml");