none
Uploaded dll is 0B [Blob Upload]

    Question

  • Hi all,

    My app upload some app file to blob storage for batch usage, here are the code:

                List<string> applicationFilePaths = new List<string>
                {
                    Environment.CurrentDirectory + "\\app\\RandomApplication.exe",
                    System.Environment.CurrentDirectory + "\\app\\Microsoft.WindowsAzure.Storage.dll",
                    Environment.CurrentDirectory + "\\app\\RandomApplication.exe.config"
                };


            private static async Task<ResourceFile> UploadFileToContainerAsync(CloudBlobClient blobClient, string containerName, string filePath)
            {
                Tools.Logs(string.Format("Uploading file {0} to container [{1}]...", filePath, containerName));
    
                string blobName = Path.GetFileName(filePath);
    
                CloudBlobContainer container = blobClient.GetContainerReference(containerName);
                CloudBlockBlob blobData = container.GetBlockBlobReference(blobName);
                await blobData.UploadFromFileAsync(filePath, FileMode.OpenOrCreate);
    
                SharedAccessBlobPolicy sasConstraints = new SharedAccessBlobPolicy
                {
                    SharedAccessExpiryTime = DateTime.UtcNow.AddHours(2),
                    Permissions = SharedAccessBlobPermissions.Read
                };
    
                // Construct the SAS URL for blob
                string sasBlobToken = blobData.GetSharedAccessSignature(sasConstraints);
                string blobSasUri = String.Format("{0}{1}", blobData.Uri, sasBlobToken);
    
                return new ResourceFile(blobSasUri, blobName);
            }

    and I have copied the related files to folder %application%\app\ , as we can see the size of Microsoft.WindowsAzure.Storage.dll with version 4.3.0.0 is 927kb:

    but after the host application uploaded the process application to blob, the size of Microsoft.WindowsAzure.Storage.dll become 0B:

    and when the RandomApplication.exe running and try to communicate with storage, some error will occur that Could not load file or assembly 'Microsoft.WindowsAzure.Storage, Version=4.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The module was expected to contain an assembly manifest.


    • Edited by William A Wang Tuesday, March 28, 2017 1:36 PM
    • Edited by Md Shihab Saturday, April 1, 2017 5:22 PM Edited title for better understanding
    Tuesday, March 28, 2017 1:30 PM

Answers

All replies