- Your current ASP.NET Core application should contain a Configure() method that looks as follows:
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) { loggerFactory.AddConsole(); if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } app.Run(async (context) => { await context.Response.WriteAsync($"The date is {DateTime.Now.ToString("dd MMM yyyy")}"); }); }
- From the Debug menu, click on Start Without Debugging or press Ctrl + F5. You will see the date displayed as follows:
- Go back to your code and tell your application to display the welcome page middleware. ...