I have WPF application, let's say Application1, run under User1. I need to access user scoped settings of User2 in AppData folder for Application2.
So, what's really happening is this:
How can I do that without running Application1 as User2?
If I can change process owner for Application1 at run time to do that, that would also be acceptable solution.
I ended up running another custom made console program under User2 which reads settings file as XmlDocument.
Reading settings file:
if (File.Exists(settingsPath))
{
XmlDocument xmlDocument = new XmlDocument();
xmlDocument.Load(settingsPath);
XmlNode settingsNode = xmlDocument.SelectSingleNode("/XPath.to.node.you.are.looking.for");
foreach(XmlNode xmlNode in settingsNode.ChildNodes)
{
//do some work
}
}