I have a WPF app (installed on Windows 10 machines) that relies on XML files for various data elements.
After building the app and installing it, the app and XML files are deployed to different folders, as follows:
XML Files
[AppData\Local\Apps...]\vita..tion_4af4e5dd3b243aa8_0001.0000_fa5707b5107abce1
EXE
[AppData\Local\Apps...]\vita..tion_4af4e5dd3b243aa8_0001.0000_f75ca9501de16621
This prevents me from accessing my files using something like this:
Directory.GetParent(Directory.GetCurrentDirectory()).Parent.FullName + "\\XML\\GeneralInfo.xml";
Questions
- How can I refer to the XML files in code?
- Is this some weird artifact of a messed-up publishing?
Thanks!
EDIT
Using Publish Wizard (or Publish Now) to publish the app.
The XML files are marked as Build Action: "Content" and Copy to Output Directory: "Copy Always" in properties.