I have a simple wpf application that contains one window with a document viewer that I use to show an XPS document, I wrote this and it worked.
XpsDocument myDoc = new XpsDocument(@"C:\Users\Ahmad
Elsayed\Desktop\testxpsdoc\xpsTest\xpsTest\Assets\Dokhna - Problems -
Report.xps", FileAccess.Read);
DV.Document = myDoc.GetFixedDocumentSequence();
the problem however is that when I publish the app and use on another pc I get this:
System.IO.DirectoryNotFoundException: Could not find a part of the path
I tried to use relative path like this:
XpsDocument myDoc = new XpsDocument(@"\Assets\Dokhna - Problems - Report.xps", FileAccess.Read);
but still the same, given that I set the built action to Content and copy if newer to the xps file.
also this is the solution explorer: Solution Explorer