Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9209059
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T00:45:12+00:00 2026-06-18T00:45:12+00:00

Ok, so Windows 8 comes with a cool PDF and XLS reader app, called

  • 0

Ok, so Windows 8 comes with a cool PDF and XLS reader app, called Reader. I have a help document that I want displayed when the user clicks the Help button inside my app. My app should launch the PDF document with whatever is the default viewer for that document type.

But it won’t. There are no errors, no exceptions and setting a breakpoint reveals no information. The code I have is:

<Button x:Name="help" Style="{StaticResource HelpAppBarButtonStyle}" Tag="Help" Click="help_Click_1" />

and:

    private async void help_Click_1(object sender, RoutedEventArgs e)
    {

        try
        {
            Windows.Storage.StorageFile file =
                await Windows.ApplicationModel.Package.Current.InstalledLocation.GetFileAsync(@"\Assets\User Guide.pdf");
            await Windows.System.Launcher.LaunchFileAsync(file);
        }
        catch (Exception exception)
        {
            Debug.WriteLine(exception.Message);
        }
    }

Now, inside solution explorer, there are the usual files and folders. I also have an Assets folder inside the root directory, and the PDF document is located inside this root folder.

I am not sure why this isn’t working, but I believe that it may have something to do with how I am pointing to the file in the above code:

await Windows.ApplicationModel.Package.Current.InstalledLocation.GetFileAsync(@"\Assets\User Guide.pdf");

How do you correctly display a document contained in the Assets folder with using the default application for that document type?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T00:45:13+00:00Added an answer on June 18, 2026 at 12:45 am

    I tested your code and I had to fix two issues before I got it to work:

    1. Make sure the Build Action for the pdf file is set to Content. It was set to None in my case when I included the file in the project.
    2. You need to delete the starting backslash in the file path: Package.Current.InstalledLocation.GetFileAsync(@"Assets\User Guide.pdf").

    After I changed both of the above the file opened in my default PDF viewer. But even before that an exception was raised describing what went wrong although I didn’t notice it at first because of your silent try/catch code.

    If it still doesn’t work for you, it’s probably something related to the configuration of your machine. Make sure the default viewer for pdf files is set up correctly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a .NET 3.5 Windows Service that comes in several different configurations/flavours ie.
I would like to automate a windows app that comes only with as a
I have a dll which is dependent of OPENGL.DLL . However, Windows comes with
Is there some default Windows scripting language that comes pre-installed on XP and Vista
Using the Resource Monitor that comes with Windows 8, I can see that my
I'm writing a Windows Phone 7 app that needs to be location aware. Specifically
I want to go from: [important text, numbers/letters only] [unknown text]/Windows/[text that I want
I've read that Windows Virtual PC comes with a COM interface (VirtualPC.Application). I've read
Windows 8 SDK comes with very cool data binding JavaScript samples. More info here:
I have some data (to be precise this data comes from Windows Registry), which

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.