I created a Wpf application, it's composed of 3 projects, in a project that is not my main project I'm accessing some config.xml file read data from and also write data to.
In my app I access this file simply as :
string xmlStr = File.ReadAllText("../Content/StationConfig.xml");
or:
doc.Save("../Content/StationConfig.xml");
It works fine on my app in debug mode, but when I publish I get the error:
could not find part of path
And the place it looks into is a on apps:
C:\Users\petric\AppData\Local\Apps\2.0\075BBVBO.9MZ\BWMQ2V0B.PE5\Content\StationConfig.xml
This file needs to be available on each PC my app will be installed into. My file build action is set to Content and it's copy to output directory is set to Copy always.
I have read a bunch of questions about this problem and still can't figure out a solution, also read this : WPF Application Resource, Content, and Data Files
Any suggestions?