问题 Problem with CreateCloudDrive method

  • 2012年7月10日 3:31
     
     

    I use a piece of code as follows to unmount all previously mounted drives when an ASP.NET application starts.

    The code lies in Application_Start function, copied from a  quite common example.

    var mapping = CloudDrive.GetMountedDrives();

    foreach (var drive in mapping)

    {

    string paq = drive.Value.PathAndQuery;

    var mountedDrive = account.CreateCloudDrive(paq);

    mountedDrive.Unmount();

    }

    The problem is that the PathAndQuery kept in the string paq begins with the account name and the CreateCloudDrive method adds the account name again to the mountedDrive.Uri.

    For example, if the account name is "devsotreaccount1" and the string paq got is "/devstoreaccount1/mydrives/SamplePictures.vhd", after the CreateCloudDrive method the Uri property of mountedDrive becomes "http://xxxx/devsotreaccount1//devsotreaccount1/xxxx", which causes an exception and makes the unmounting fail.

    Since the example code can be found almost everywhere on the Internet, i can hardly believe it's wrong. Although the problem is easy to fix by manually modifying the paq string, i don't understand why this happens to me. Is there any method prepared for such situation?

全部回复

  • 2012年7月10日 8:08
     
     
    Do you want to use Local Storage for Drive? As far as i know, it's not support.
  • 2012年7月10日 9:45
     
     
    Storage Emulator implements blobs as .VHD folders in somewhere in local machine. It was the emulator in use when the problem occurred.
  • 2012年7月19日 16:39
     
     
    I am experiencing the same issue.  To be clear, it is just a problem with the local emulator?