You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Microsoft Visual Studio Community 2022 (64-bit) - Preview Version 17.9.0 Preview 3.0
Did it work in .NET Framework?
Yes
Did it work in any of the earlier releases of .NET Core or .NET 5+?
Don't think so
Issue description
When you download a large file with a progress UI, and then cancel the request through UI the download completes and then the cancel error is thrown. Also, on Framework the partially download file is deleted and .NET Core the fully download file is left in the destination directory.
The code below is a test, it is includes and 3 PR's
<WinFormsFact>
Public Sub DownloadWithUI()
Dim tmpFilePath As String = CreateTempDirectory()
Dim destinationFilename As String = CreateTempFile(tmpFilePath, 0)
My.Computer.Network.DownloadFile("https://ash-speed.hetzner.com/100MB.bin",
destinationFilename,
"",
"",
True,
100000,
True
)
Assert.Equal(ValidateDownLoad(tmpFilePath, destinationFilename), 104857600)
CleanupTempDirectory(tmpFilePath)
End Sub
Steps to reproduce
Download a large file with UI using My.Computer.Network.DownloadFile and the cancel operation.
Download will complete before CancelOperation is thrown and resulting file is in destination directory, in Framework cancel is immediate and file is deleted.
The text was updated successfully, but these errors were encountered:
paul1956
changed the title
My.Computer.Network.DownloadFile down not cancel immediately
My.Computer.Network.DownloadFile does not cancel immediately
Jan 21, 2024
@KlausLoeffelmann do you think this makes more sense as a breaking (between NetFX and Core) change that is documented, or do you think a fix is the better answer for .NET 10?
.NET version
Microsoft Visual Studio Community 2022 (64-bit) - Preview Version 17.9.0 Preview 3.0
Did it work in .NET Framework?
Yes
Did it work in any of the earlier releases of .NET Core or .NET 5+?
Don't think so
Issue description
When you download a large file with a progress UI, and then cancel the request through UI the download completes and then the cancel error is thrown. Also, on Framework the partially download file is deleted and .NET Core the fully download file is left in the destination directory.
The code below is a test, it is includes and 3 PR's
Steps to reproduce
Download a large file with UI using My.Computer.Network.DownloadFile and the cancel operation.
Download will complete before CancelOperation is thrown and resulting file is in destination directory, in Framework cancel is immediate and file is deleted.
The text was updated successfully, but these errors were encountered: