标签:ppi div http stop console configure conf name time
public void Configure(IApplicationBuilder app, IHostingEnvironment env) { app.Run(async (context) => { await context.Response.WriteAsync($"ApplicationName:{env.ApplicationName}"); await context.Response.WriteAsync($"ContentRootPath:{env.ContentRootPath}"); await context.Response.WriteAsync($"WebRootPath:{env.WebRootPath}"); await context.Response.WriteAsync($"是否开发环境:{env.IsDevelopment()}"); }); }
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory, IApplicationLifetime applicationLifetime) { applicationLifetime.ApplicationStarted.Register(() => { Console.WriteLine("ApplicationStarted"); }); applicationLifetime.ApplicationStopped.Register(() => { Console.WriteLine("ApplicationStopped"); }); applicationLifetime.ApplicationStopping.Register(() => { Console.WriteLine("ApplicationStopping"); }); }
ASP.NET Core 2.0 IHostEnvironment和IApplicationLifetime介绍
标签:ppi div http stop console configure conf name time
原文地址:https://www.cnblogs.com/lgxlsm/p/9104154.html