locked
CreateFolderAsync problem in Windows 8.1 RRS feed

  • Question

  • Hello,

    I'm sure the following line of code worked in Windows 8 but throws an error in Windows 8.1:

    MyFolder = await Windows.Storage.KnownFolders.VideosLibrary.CreateFolderAsync(sMyFolder, Windows.Storage.CreationCollisionOption.OpenIfExists);

     I get 'System.IO.FileNotFoundException'. I've looked for an explanation in the docs but so far haven't come up with anything.

    Thursday, October 24, 2013 3:40 AM

All replies

  • To update my findings on this, it actually works on the remote debugging Samsung Slate but not on the desktop local machine. I can't imagine why this would be happening so any help appreciated.
    Thursday, October 24, 2013 4:09 AM
  • Hi FSound,

    I don't know what's happening on your machine, but the code works fine with me, my OS is Windows 8.1.

    The error message is "System.IO.FileNotFoundException", this exception thrown when an attempt to access a file that does not exist on disk fails. I'm not sure if you will immediately use the folder once the folder has been created or opened. Thus you might meet the situation as this article metioned: Deceptive simplicity of async and await. Take a look and you could follow the example one to create a Task.

    If still not solved we can try to find if there are other possibilities.

    Best Regards,

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Thursday, October 24, 2013 6:24 AM
    Moderator
  • Thanks for taking a look. It seems the problem is just on the one machine at the moment. I'm not trying to use the folder immediately although I did already have a read of that other thread and tried the first solution to no avail. I'll update here if I can track the cause down.

    Thursday, October 24, 2013 9:14 AM