Servicestack.net Mini Profiler in razor view

2019-02-18 06:37发布

问题:

Is it possible to use the mini profiler in service stack with the razor views? It looks like the documentation only shows the profiler when using the json html report view.

回答1:

Yes you can include it using the same MVC include but include it .AsRaw() so it doesn't get HTML encoded, e.g:

@ServiceStack.MiniProfiler.Profiler.RenderIncludes().AsRaw()

Example taken from this RazorRockstars template.