I'm exploring ASP.NET Core Web Applocation empty template. And I'm little bit confused there: if I run the application created by VS new project wizard with no changes and break point on WriteAsync method I could see that it runs two times.
app.Run(async (context) =>
{
await context.Response.WriteAsync("Hello World!");
});
Does anybody know if this is normal behaviour or a kind of bug?
You can use logging for diagnosing these kind of issues. You can use the Debug logger to see the log messages in the debug output window.
Add the package Microsoft.Extensions.Logging.Debug to your project.json and do the following in Startup.cs's Configure method:
loggerFactory.AddDebug()
Regarding why you are seeing 2 times, I guess one of the requests is for the fav.ico from the browser.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With