Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use HttpClient instead of WebClient for the updater #243

Open
PiKeyAr opened this issue Jun 11, 2023 · 2 comments
Open

Use HttpClient instead of WebClient for the updater #243

PiKeyAr opened this issue Jun 11, 2023 · 2 comments

Comments

@PiKeyAr
Copy link
Member

PiKeyAr commented Jun 11, 2023

Since the .NET 5.0 upgrade it's impossible to actually cancel an update for SA Tools in the Hub. This is because the implementation of WebClient is different between Framework and Core. WebClient in .NET 5.0 and higher no longer cancels the download in progress.

Microsoft treat WebClient as a deprecated class so they don't want to fix it. HttpClient is the recommended replacement but it lacks some features WebClient has out of the box, so it needs some workarounds to display download progress.

This issue will also affect the Mod Loader rewrite if it is upgraded to 5.0 or later.

@PiKeyAr
Copy link
Member Author

PiKeyAr commented Jun 11, 2023

Useful comment: dotnet/runtime#31479 (comment)

@MainMemory
Copy link
Contributor

Maybe we just find some library that does what we want, or make something ourselves using raw streams.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants