用于ASP.NET网站的Miniprofiler
如何在asp.net网站(不适用于MVC)中使用miniprofiler? 有很多关于MVC的资源,但我找不到任何关于网站的资源 多亏了亚历克斯。现在它适用于asp.net网站。但我不明白它显示了什么。 我没有在方法中编写任何代码。见下图 代码如下,我为其运行了探查器用于ASP.NET网站的Miniprofiler,asp.net,web,mvc-mini-profiler,Asp.net,Web,Mvc Mini Profiler,如何在asp.net网站(不适用于MVC)中使用miniprofiler? 有很多关于MVC的资源,但我找不到任何关于网站的资源 多亏了亚历克斯。现在它适用于asp.net网站。但我不明白它显示了什么。 我没有在方法中编写任何代码。见下图 代码如下,我为其运行了探查器 protected void Page_Load(object sender, EventArgs e) { using (MiniProfiler.Current.Step("test")) {
protected void Page_Load(object sender, EventArgs e)
{
using (MiniProfiler.Current.Step("test"))
{
Page.Title = "12345";
}
}
从:
PM>安装软件包微型档案器
在您的global.asax中
:
using StackExchange.Profiling;
...
protected void Application_BeginRequest()
{
if (Request.IsLocal)
{
MiniProfiler.Start();
}
}
protected void Application_EndRequest()
{
MiniProfiler.Stop();
}
然后在母版页的某个地方:
<%= StackExchange.Profiling.MiniProfiler.RenderIncludes() %>
这应该足够开始了。谢谢Alex,现在我可以看到分析器了,但我不明白它到底意味着什么。你能指引我吗?请参阅我随附的已编辑问题的代码和图像。@ChiragFanse:通过使用
MiniProfiler.Current.Step(“test”)
您正在创建一个名为“test”的配置文件步骤。通常,您可以在步骤中加入一些重要的逻辑,然后查看这些步骤的统计信息。当我在浏览器中查看呈现的HTML中的何处时,那里没有显示任何内容。但是没有错误或任何东西。@MatthewLock:您确定在begin请求事件处理程序中启动了MP吗?是的。我甚至在它上面放了一个断点,以确认它正在被调用。