locked
Im getting this error when copying a document to my StorageFolder ("The system cannot find the file specified. (Exception from HRESULT: 0x80070002)")

    Question

  • im able to copy other text files but when it comes to a pdf ,doc and other i get that exception here's my code below 

     StorageFile file = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///Assets/Doc 2014.pdf"));
                    await file.CopyAsync(ApplicationData.Current.LocalFolder, "BoardView 2014.pdf");
    How can i get this right ?


    19karabo91


    • Edited by 19karabo91 Wednesday, August 20, 2014 10:04 AM
    Wednesday, August 20, 2014 10:03 AM

Answers

  • Did you set the Build Action of the pdf file to "Content" in the Properties pane in Visual Studio?

    It should work then.

    • Marked as answer by 19karabo91 Wednesday, August 20, 2014 12:09 PM
    Wednesday, August 20, 2014 10:45 AM

All replies

  • Did you set the Build Action of the pdf file to "Content" in the Properties pane in Visual Studio?

    It should work then.

    • Marked as answer by 19karabo91 Wednesday, August 20, 2014 12:09 PM
    Wednesday, August 20, 2014 10:45 AM
  • Thank you so much u just saved me a lot of time ,i can't believe its that easy.Thanks a lot for you help Magnus u the best 

    19karabo91

    Wednesday, August 20, 2014 12:10 PM