使用 MiniProfiler 来分析 ASP.NET Core 应用性能

原文:https://www.cnblogs.com/cgzl/p/11027243.html

工具官网:https://miniprofiler.com/

以下转自太长不看版:https://my.oschina.net/TOW/blog/3108358

1、添加包 MiniProfiler.AspNetCore.Mvc   和    MiniProfiler.EntityFrameworkCore

 

2、在 Startup.cs 中的 ConfigureServices 下添加,也可以根据官方文档中的说明进行相应的配置

services.AddMiniProfiler().AddEntityFramework();


3、在 Startup.cs 中的 Configure 下添加

app.UseMiniProfiler();


4、修改 _ViewImports.cshtml

@using StackExchange.Profiling
@addTagHelper *, MiniProfiler.AspNetCore.Mvc


5、将MiniProfiler添加到布局文件(Shared/_Layout.cshtml)中

<mini-profiler />

posted @ 2020-03-15 01:06  不是豆豆  阅读(273)  评论(0编辑  收藏  举报
友情链接:迷途