Closed
Description
I have tested this defect on .net core 2.2 and 3.0. It's a bug when using IIS Express but it's working as expected when switch to Kestrel. OnCompleted doesn't fire after response.
Steps to reproduce:
Run the following code in IIS express and put the breakpoint on "await Task.Delay(2000); " line.
You will see the response is sent in the browser and then the following code is executed when using the Kestrel server but when you switch to IIS Express, the response is not sent in the browser.
[HttpGet]
public string Get()
{
try
{
// Some work
return "talal";
}
finally
{
Response.OnCompleted(async () =>
{
// Put breakpoint here
await Task.Delay(2000);
});
}
}