要查看页面耗时,EFCore的性能.
Install-Package MiniProfiler.AspNetCore.Mvc
编辑Startup.cs
public void ConfigureServices(IServiceCollection services) { //EFCore性能监控 services.AddMiniProfiler().AddEntityFramework(); ... }
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory, IMemoryCache cache)
{
app.UseMiniProfiler();
// The call to app.UseMiniProfiler must come before the call to app.UseMvc
app.UseMvc(routes =>
{
// ...
});
}
编辑 _ViewImports.cshtml
:
@using StackExchange.Profiling
@addTagHelper *, MiniProfiler.AspNetCore.Mvc
Add MiniProfiler to your master layout (Shared/_Layout.cshtml
by default):
<mini-profiler />
把旧系统迁移到.Net Core 2.0 日记 (20) --使用MiniProfiler for .NET
原文:https://www.cnblogs.com/zitjubiz/p/10420045.html