Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

blazor OnInitializedAsync Unhandled exception rendering component: Cannot wait on monitors on this runtime.

// Avoid .Result, it can easily deadlock.
// This error is because it's not supported by single threaded Web Assembly

private static async Task CalApi()
{
   	var response = await httpClient.GetAsync(path); 
  	if (response.IsSuccessStatusCode) { ... }
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #blazor #OnInitializedAsync #Unhandled #exception #rendering #Cannot #wait #monitors
ADD COMMENT
Topic
Name
6+6 =