try
try copied to clipboard
Page freeze. High cpu usage
Describe the bug
Please provide as much information as you can. Type program
using System;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
public class Program
{
public static async Task Main()
{
await new HttpClient().GetAsync("http://github.com/");
}
}
Did this error occur while using dotnet try or online?
- [ ]
dotnet-try - [x] online
What kind of error was it?
- [ ] User Interface (UI): For example the output never displayed
- [ ] Service Error: For example "The service is temporarily unavailable. We are working on it"
- [x] Other: Page freeze with high cpu usage

Screenshots
If applicable, add screenshots to help explain your problem.
Please complete the following:
- OS
- [ ] Windows 10
- [ ] macOS
- [ ] Linux (Please specify distro)
- [ ] iOS
- [ ] Android
- Browser
- [x] Chrome
- [ ] Edge
- [ ] Safari
It's a known limitation of this version that async/await will hang. We're hoping to fix this when we move to the GA release of Blazor WASM.
See also: #242, #527.
Still hangs, simpler to repro with Task.Delay, click to repro:
using System;
using System.Threading.Tasks;
public class Program
{
public async static Task Main()
{
await Task.Delay(1000);
Console.WriteLine("Hello after a delay!");
}
}