Could not find a part of the path on windows azure

后端 未结 1 511
深忆病人
深忆病人 2020-12-11 16:54

I deployed mvc-3 application on windows azure. In my application i am uploading the file an save it in the App_Data/DownloadedTemplates folder.

         


        
相关标签:
1条回答
  • 2020-12-11 17:26

    You shouldn't be doing this in a Windows Azure application. In Windows Azure you should use LocalResources (reserved space on a dedicated disk) for saving temp files on the disk, this is the only place where you should store data.

    Here is an example of how you would access such a LocalResource (name and size can be configured in the VS project):

    LocalResource localResource = RoleEnvironment.GetLocalResource("DownloadedTemplates");
    

    Don't forget that data in LocalResources might disappear (when the machine crashes for example). If you really want to persist your data, you should be using Windows Azure Blob Storage.

    0 讨论(0)
提交回复
热议问题