.Net Core使用 MiniProfiler 进行性能分析(转)

转自:http://www.cnblogs.com/ideacore/p/9505425.htmlhtml

官方文档: https://miniprofiler.com/dotnet/AspDotNetCoreapp

一、添加包 MiniProfiler.AspNetCore.Mvc   和    MiniProfiler.EntityFrameworkCoreide

二、在 Startup.cs 中的 ConfigureServices 下添加,也能够根据官方文档中的说明进行相应的配置布局

services.AddMiniProfiler().AddEntityFramework();

三、在 Startup.cs 中的 Configure 下添加idea

app.UseMiniProfiler();

四、修改 _ViewImports.cshtml code

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

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

<mini-profiler />

最后查看效果blog

实际使用中能够考虑判断当前环境为开发环境再开启该功能。ip

相关文章
相关标签/搜索