Open file added to project root RRS feed

  • Question

  • Hello!

    I am developing a Windows 8 app and I can not find how to open a "chart.html" file that I added to the project. I already examined all of the sample applications, I opened a file that is in the Documents directory, but I don't know how to find the path of a file added to the project.

    Any response is welcomed. Thank you.


    Thursday, January 5, 2012 11:42 AM


  • If your file is added to the project with a "Content" build action, it will be installed on the client system as part of the app package. You can use the following code to get it:

    var installationFolder = Package.Current.InstalledLocation;
    var filesFolder = await installationFolder.GetFolderAsync("Charts");
    var file = await contentFolder.GetFileAsync("chart.html");

    where "Charts" is a name of a project folder with all your custom files.

    Thursday, January 5, 2012 1:28 PM

All replies