locked
RoamingState/LocalState Folder - Creating SubFolders?...

    Question

  • Hi,

    Not having success in creating SubFolders in RoamingState folder.  I get:

    "The filename, directory name, or volume label syntax is incorrect. (Exception from HRESULT: 0x8007007B)".

    ..using 

    C:\Users\Nasheayahu\AppData\Local\Packages\0a109bd3-b6c6-456c-835c-ea5ae7dc550c_9zkhtcdrrpqqp\RoamingState\Data

    Code:

    private void CheckSetupDataDirectory(string path, string dataDir)
    {
    	string d = Path.Combine(path, dataDir);
    
    	var Info = this._propertiesService.RoamingStorageFolder.GetFolderAsync(d);
    	if (Info.Status == Windows.Foundation.AsyncStatus.Error )
    	{
    		var folder = this._propertiesService.RoamingStorageFolder.CreateFolderAsync(d, CreationCollisionOption.OpenIfExists);
    	}
    }

    I should be able to do this correct?


    Code is like a box of chocolates!...


    • Edited by VcDeveloper Wednesday, November 12, 2014 7:06 PM
    Wednesday, November 12, 2014 7:05 PM

Answers

  • Cancel that!  I found the problem, I didn't need to create the path when I already have it in:

    this.RoamingStorageFolder = ApplicationData.Current.RoamingFolder;
    ....all I had to do is give the subfolder name I wanted to create.


    Code is like a box of chocolates!...

    • Marked as answer by VcDeveloper Wednesday, November 12, 2014 7:22 PM
    Wednesday, November 12, 2014 7:22 PM

All replies

  • Cancel that!  I found the problem, I didn't need to create the path when I already have it in:

    this.RoamingStorageFolder = ApplicationData.Current.RoamingFolder;
    ....all I had to do is give the subfolder name I wanted to create.


    Code is like a box of chocolates!...

    • Marked as answer by VcDeveloper Wednesday, November 12, 2014 7:22 PM
    Wednesday, November 12, 2014 7:22 PM
  • Hello,

    I am glad to hear that you have solved the problem. You are always welcome.

    Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. Click HERE to participate the survey.

    Thursday, November 13, 2014 2:07 AM
    Moderator