A VB.NET desktop application freezes while waiting for a web request. How would you redesign it?
Interactive Practice Mode
Formulate your thoughts or take notes before revealing the model solution.
Saved automatically
Model Answer & Deep-Dive Explanation
Use a genuinely asynchronous I/O API and Await it from an asynchronous event handler so the UI message loop can continue processing input. Keep longer CPU-bound work off the UI thread where appropriate, and update controls on the correct thread. Disable or coordinate repeated submissions, expose cancellation, and handle exceptions with a useful UI state. Avoid blocking on Task.Result or Wait. Async Sub is appropriate for framework event-handler signatures; reusable asynchronous methods should generally return Task or Task(Of T) so callers can await completion and observe errors.
Related Questions in Visual Basic
VB 6, COM, DCOM, Microsoft platform interview questions
Advanced level • 773 views
Visual Basic Interview questions
Advanced level • 701 views
What do Option Strict On and Option Explicit On help catch in VB.NET?
Easy level • 66 views
In VB.NET, how do Sub and Function differ?
Easy level • 61 views
How do ByVal and ByRef behave when a VB.NET parameter refers to an object?
Medium level • 55 views