如何在asp.net网站(NOT FOR MVC)中使用miniprofiler? MVC有很多资源,但我找不到网站的任何内容。
感谢Alex。现在它适用于asp.net网站。但我无法理解它显示的是什么。 我没有在方法中编写任何代码。见下图。
代码如下所示,我运行了探查器。
protected void Page_Load(object sender, EventArgs e)
{
using (MiniProfiler.Current.Step("test"))
{
Page.Title = "12345";
}
}
答案 0 :(得分:26)
PM> Install-Package MiniProfiler
在global.asax
:
using StackExchange.Profiling;
...
protected void Application_BeginRequest()
{
if (Request.IsLocal)
{
MiniProfiler.Start();
}
}
protected void Application_EndRequest()
{
MiniProfiler.Stop();
}
然后在您母版页的某个位置:
<%= StackExchange.Profiling.MiniProfiler.RenderIncludes() %>
这应该足以让你开始。