Answers for " core miniprofiler"

0 core miniprofiler

Install-Package MiniProfiler.AspNetCore.Mvc -IncludePrerelease
//Once installed, modify your startup.cs code like the following.

public void ConfigureServices(IServiceCollection services)
    services.AddMiniProfiler(options => options.RouteBasePath = "/profiler").AddEntityFramework();
//Next we need add the MiniProfiler middleware, you can do like this.

public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
    /* Code removed for brevity. */
//Next add the following two lines inside the <html> tag in the _Layout.cshtml file.

@using StackExchange.Profiling
@addTagHelper *, MiniProfiler.AspNetCore.Mvc
//You should also specify where in the web page the MiniProfiler window should be displayed, i.e., the render position. To do this, you can include the following statement inside the <body> tag.

<mini-profiler position="@RenderPosition.Right" max-traces="5" />
Posted by: Guest on June-02-2021

C# Answers by Framework

Browse Popular Code Answers by Language