Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
When PictureBox loads an image from a URL and a network error occurs, it now raises HttpClient exceptions, such as HttpRequestException and TaskCanceledException, instead of WebException.
.NET 9 Preview 6
Previously, when PictureBox failed to load an image from a URL due to a network error, a WebException was thrown.
Starting in .NET 9, when PictureBox fails to load an image from a URL due to a network error, HttpRequestException or TaskCanceledException is thrown.
This change is a behavioral change.
WebClient is obsolete.
Update your code to catch HttpRequestException and TaskCanceledException instead of WebException.
- PictureBox control
.NET feedback
.NET is an open source project. Select a link to provide feedback: