The following are examples of creating middleware in Mvc6, and all of the examples use the WriteAsync function. Something like that:
if (HttpContext.Request.Path.Value == "/MyHttpHandler")
{
HttpContext.Response.WriteAsync("This is my HttpHandler ...");
}
The error I get: HttpResponsedoes not contain a definition for, WriteAsyncand the extension method 'WriteAsync' cannot be found that takes the first type argument HttpResponse.
The project was created in VS2017an ASP.NET 5 web application.
Project Dependence:
"Microsoft.AspNet.Mvc": "6.0.0-rc1-final"
Where is the WriteAsync function?
source
share