Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

No WriteSync method on HttpResponse

$
0
0

I'm stuck and not sure why this isn't working.  I want to write to the HttpResponse object thusly in my Configure method of Startup.cs:

app.Run(async context =>
{
      await context.Response.WriteAsyc("Return from run.");
});

but VS2017 (with latest update) says:

Error CS1061 'HttpResponse' does not contain a definition for 'WriteAsyc' and no extension method 'WriteAsyc' accepting a first argument of type 'HttpResponse' could be found (are you missing a using directive or an assembly reference?)

It seems this method was moved into an extension class called HttpResponseWritingExtensions in Microsoft.AspNetCore.Http.Abstractions.  I added a reference to this using NuGet Package Manager, but I'm still getting the error.  What am I doing wrong?


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>