I reproduced this problem using .net core.
I used .net framework 4.7.2 before, as you can see, everything is normal.
But when I use .net core for testing, the problem occurs. I use all the .net core versions (2.0, 2.1, 3.1 and .net 5) on my machine for testing, and the problem always exists.
I did some investigation, and the problem may be in the private ProgressData class in this link, it exists as a field in WebClient: ProgressData
In the .net framework, it is: ProgressData m_Progress;
In .net core, it is modified to: private ProgressData? _progress;
At the same time, other codes have also undergone a lot of changes, but I haven't found which part of the code changes cause TotalBytesToSend to always be -1, so I can't give you an accurate answer yet.
I will continue to investigate. You can also ask questions in the GitHub repository of .net core and ask them to investigate.
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.