I'm trying to plumb MiniProfiler into my ASP.NET Core MVC web app. I'm not using Entity Framework, I'm using Dapper.
Following the sample app, here are my changes:
Added to
Startup.cs
ConfigureServices
services.AddMiniProfiler();
Added to
Startup.cs
Configure
app.UseMiniProfiler(new MiniProfilerOptions { // Path to use for profiler URLs RouteBasePath = "~/profiler",
// Control which SQL formatter to use SqlFormatter = new StackExchange.Profiling.SqlFormatters.InlineFormatter(), // Control storage Storage = new MemoryCacheStorage(cache, TimeSpan.FromMinutes(60)), // To control which requests are profiled, use the Func<HttpRequest, bool> option: ShouldProfile = request => true, // Profiles are stored under a user ID, function to get it: //UserIdProvider = request => MyGetUserIdFunction(request),
});
Configured the tag helper in my
_ViewImports
as per the sampleAdded the tag helper to my
_Layout
file, just before the close of thebody
tag:
<mini-profiler position="@RenderPosition.Left" max-traces="5" show-controls="true" start-hidden="false" />
Made sure my controller produces some output for MiniProfiler:
using (MiniProfiler.Current.Step("Example step")) { ... }
Despite all this, I get nothing. When I view source, I see that the tag helper has not produced any HTML.