I'm developing a UWP app and I want the user to be able to open a PDF stored in my app in Reader or a browser on the user's desktop.
I first used the following code-behind from an app bar button click:
string filename1 = "ModelHouseAppStencils.pdf";
I got the following exception:
System.ComponentModel.Win32Exception: 'The system cannot find the file specified'
Then I used the code:
StorageFile file1 = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///Assets/ModelHouseAppStencils.pdf"));
I then got the following exception:
Exception thrown: 'System.IO.FileNotFoundException' in System.Private.CoreLib.dll
What do I do to solve this? Thanks.