1
私は、ASP.NET Core MVC WebアプリケーションにMiniProfilerを接続しようとしています。私はEntity Frameworkを使用していない、私はDapperを使用している。ASP.NETコアにMiniProfilerが表示されない
1)は、タグヘルパーで設定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),
});
3)に追加Startup.cs
ConfigureServices
services.AddMiniProfiler();
2)に追加しました:sample app後
、ここに私の変更があります私の_ViewImports
はサンプルあたり
using (MiniProfiler.Current.Step("Example step"))
{ ... }
:
<mini-profiler position="@RenderPosition.Left" max-traces="5" show-controls="true" start-hidden="false" />
5)私のコントローラはMiniProfilerためのいくつかの出力を生成し確認しました:
4)body
タグの近くにはちょうど前に、私の_Layout
ファイルにタグヘルパーを追加しましたこのすべて、私は何も得られない。ソースを見ると、タグヘルパーがHTMLを生成していないことがわかります。誰も助言することはできますか?
これを見つけた方は、http://miniprofiler.com/dotnet/(http://miniprofiler.com/dotnet/)にdocs(開始を含む)が設定されています。 –