2021
09-04
09-04
.net core异常中间件的使用
目录正文结正文if(env.IsDevelopment()){app.UseDeveloperExceptionPage();}这样写入中间件哈,那么在env环境下就会去执行UseDeveloperExceptionPage。publicstaticIApplicationBuilderUseDeveloperExceptionPage(thisIApplicationBuilderapp){if(app==null){thrownewArgumentNullException(nameof(app));}returnapp.UseMiddleware<DeveloperExceptionPageMiddleware>();}那么我们应该去看DeveloperExceptionPa...
继续阅读 >