Skip to content

Commit d639661

Browse files
committed
Resolve the issue that cannot upload blob with 0 size..
1 parent e6a42fa commit d639661

File tree

5 files changed

+16
-12
lines changed

5 files changed

+16
-12
lines changed

src/Common/Storage/Commands.Storage.Test/Commands.Storage.Test.csproj

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,17 +116,19 @@
116116
<SpecificVersion>False</SpecificVersion>
117117
<HintPath>..\..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.Desktop.dll</HintPath>
118118
</Reference>
119-
<Reference Include="Microsoft.WindowsAzure.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
120-
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.ConfigurationManager.2.0.3\lib\net40\Microsoft.WindowsAzure.Configuration.dll</HintPath>
119+
<Reference Include="Microsoft.WindowsAzure.Configuration, Version=1.8.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
120+
<SpecificVersion>False</SpecificVersion>
121+
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.ConfigurationManager.1.8.0.0\lib\net35-full\Microsoft.WindowsAzure.Configuration.dll</HintPath>
121122
</Reference>
122123
<Reference Include="Microsoft.WindowsAzure.Management">
123124
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.Management.4.1.1\lib\net40\Microsoft.WindowsAzure.Management.dll</HintPath>
124125
</Reference>
125126
<Reference Include="Microsoft.WindowsAzure.Storage">
126127
<HintPath>..\..\..\packages\WindowsAzure.Storage.6.1.0\lib\net40\Microsoft.WindowsAzure.Storage.dll</HintPath>
127128
</Reference>
128-
<Reference Include="Microsoft.WindowsAzure.Storage.DataMovement">
129-
<HintPath>..\..\..\packages\Microsoft.Azure.Storage.DataMovement.0.2.69\lib\net45\Microsoft.WindowsAzure.Storage.DataMovement.dll</HintPath>
129+
<Reference Include="Microsoft.WindowsAzure.Storage.DataMovement, Version=0.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
130+
<SpecificVersion>False</SpecificVersion>
131+
<HintPath>..\..\..\packages\Microsoft.Azure.Storage.DataMovement.0.2.0\lib\net45\Microsoft.WindowsAzure.Storage.DataMovement.dll</HintPath>
130132
</Reference>
131133
<Reference Include="Newtonsoft.Json">
132134
<HintPath>..\..\..\packages\Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll</HintPath>

src/Common/Storage/Commands.Storage.Test/packages.config

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<package id="Microsoft.Azure.Common.Dependencies" version="1.0.0" targetFramework="net45" />
77
<package id="Microsoft.Azure.KeyVault.Core" version="1.0.0" targetFramework="net45" />
88
<package id="Microsoft.Azure.Management.Resources" version="2.18.7-preview" targetFramework="net45" />
9-
<package id="Microsoft.Azure.Storage.DataMovement" version="0.2.69" targetFramework="net45" />
9+
<package id="Microsoft.Azure.Storage.DataMovement" version="0.2.0" targetFramework="net45" />
1010
<package id="Microsoft.Azure.Test.HttpRecorder" version="1.0.5799.28345-prerelease" targetFramework="net45" />
1111
<package id="Microsoft.Bcl" version="1.1.9" targetFramework="net45" />
1212
<package id="Microsoft.Bcl.Async" version="1.0.168" targetFramework="net45" />
@@ -18,7 +18,7 @@
1818
<package id="Microsoft.Net.Http" version="2.2.28" targetFramework="net45" />
1919
<package id="Microsoft.Rest.ClientRuntime" version="1.8.2" targetFramework="net45" />
2020
<package id="Microsoft.Rest.ClientRuntime.Azure.Authentication" version="0.11.0" targetFramework="net45" />
21-
<package id="Microsoft.WindowsAzure.ConfigurationManager" version="2.0.3" targetFramework="net45" />
21+
<package id="Microsoft.WindowsAzure.ConfigurationManager" version="1.8.0.0" targetFramework="net45" />
2222
<package id="Microsoft.WindowsAzure.Management" version="4.1.1" targetFramework="net45" />
2323
<package id="Newtonsoft.Json" version="6.0.8" targetFramework="net45" />
2424
<package id="System.Spatial" version="5.6.4" targetFramework="net45" />

src/Common/Storage/Commands.Storage/Blob/StorageDataMovementCmdletBase.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,8 @@ protected TransferContext GetTransferContext(DataMovementUserData userData)
114114
{
115115
if (userData.Record != null)
116116
{
117-
userData.Record.PercentComplete = (int)(transferProgress.BytesTransferred * 100 / userData.TotalSize);
117+
// Size of the source file might be 0, when it is, directly treat the progress as 100 percent.
118+
userData.Record.PercentComplete = 0 == userData.TotalSize ? 100 : (int)(transferProgress.BytesTransferred * 100 / userData.TotalSize);
118119
userData.Record.StatusDescription = string.Format(CultureInfo.CurrentCulture, Resources.FileTransmitStatus, userData.Record.PercentComplete);
119120
this.OutputStream.WriteProgress(userData.Record);
120121
}

src/Common/Storage/Commands.Storage/Commands.Storage.csproj

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,8 @@
106106
<HintPath>..\..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.Desktop.dll</HintPath>
107107
</Reference>
108108
<Reference Include="Microsoft.WindowsAzure.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
109-
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.ConfigurationManager.2.0.3\lib\net40\Microsoft.WindowsAzure.Configuration.dll</HintPath>
109+
<SpecificVersion>False</SpecificVersion>
110+
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.ConfigurationManager.2.0.0.0\lib\net40\Microsoft.WindowsAzure.Configuration.dll</HintPath>
110111
</Reference>
111112
<Reference Include="Microsoft.WindowsAzure.Management">
112113
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.Management.4.1.1\lib\net40\Microsoft.WindowsAzure.Management.dll</HintPath>
@@ -117,7 +118,7 @@
117118
</Reference>
118119
<Reference Include="Microsoft.WindowsAzure.Storage.DataMovement, Version=0.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
119120
<SpecificVersion>False</SpecificVersion>
120-
<HintPath>..\..\..\packages\Microsoft.Azure.Storage.DataMovement.0.2.69\lib\net45\Microsoft.WindowsAzure.Storage.DataMovement.dll</HintPath>
121+
<HintPath>..\..\..\packages\Microsoft.Azure.Storage.DataMovement.0.2.0\lib\net45\Microsoft.WindowsAzure.Storage.DataMovement.dll</HintPath>
121122
</Reference>
122123
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
123124
<SpecificVersion>False</SpecificVersion>
@@ -295,7 +296,7 @@
295296
<Link>Azure.Storage.psd1</Link>
296297
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
297298
</None>
298-
<None Include="AzureStorageStartup.ps1" >
299+
<None Include="AzureStorageStartup.ps1">
299300
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
300301
</None>
301302
<None Include="Microsoft.WindowsAzure.Commands.Storage.format.ps1xml">

src/Common/Storage/Commands.Storage/packages.config

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<package id="Microsoft.Azure.Common.Dependencies" version="1.0.0" targetFramework="net45" />
77
<package id="Microsoft.Azure.KeyVault.Core" version="1.0.0" targetFramework="net45" />
88
<package id="Microsoft.Azure.Management.Resources" version="2.18.7-preview" targetFramework="net45" />
9-
<package id="Microsoft.Azure.Storage.DataMovement" version="0.2.69" targetFramework="net45" />
9+
<package id="Microsoft.Azure.Storage.DataMovement" version="0.2.0" targetFramework="net45" />
1010
<package id="Microsoft.Bcl" version="1.1.9" targetFramework="net45" />
1111
<package id="Microsoft.Bcl.Async" version="1.0.168" targetFramework="net45" />
1212
<package id="Microsoft.Bcl.Build" version="1.0.14" targetFramework="net45" />
@@ -17,7 +17,7 @@
1717
<package id="Microsoft.Net.Http" version="2.2.28" targetFramework="net45" />
1818
<package id="Microsoft.Rest.ClientRuntime" version="1.8.2" targetFramework="net45" />
1919
<package id="Microsoft.Rest.ClientRuntime.Azure.Authentication" version="0.11.0" targetFramework="net45" />
20-
<package id="Microsoft.WindowsAzure.ConfigurationManager" version="2.0.3" targetFramework="net45" />
20+
<package id="Microsoft.WindowsAzure.ConfigurationManager" version="2.0.0.0" targetFramework="net45" />
2121
<package id="Microsoft.WindowsAzure.Management" version="4.1.1" targetFramework="net45" />
2222
<package id="Newtonsoft.Json" version="6.0.8" targetFramework="net45" />
2323
<package id="System.Spatial" version="5.6.4" targetFramework="net45" />

0 commit comments

Comments
 (0)