Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/asp.net-mvc/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 微型探查器不显示_C#_Asp.net Mvc_Mvc Mini Profiler - Fatal编程技术网

C# 微型探查器不显示

C# 微型探查器不显示,c#,asp.net-mvc,mvc-mini-profiler,C#,Asp.net Mvc,Mvc Mini Profiler,我正在使用MiniProfiler v3.2.0.157和MiniProfiler.EF6 v3.0.11以及C#作为ASP.NET MVC 4网站。虽然我可以让探查器显示在站点的大多数页面上,但它不会显示在登录页面上 我已经尝试了这里建议的一切: 在这里: 没有成功 更新:我还尝试了下面介绍的甜甜圈缓存技术: 我注意到,对于可以工作的页面,如果在MiniProfiler.Start()上的Application\u BeginRequest中有一个断点,MiniProfiler.Curren

我正在使用MiniProfiler v3.2.0.157和MiniProfiler.EF6 v3.0.11以及C#作为ASP.NET MVC 4网站。虽然我可以让探查器显示在站点的大多数页面上,但它不会显示在登录页面上

我已经尝试了这里建议的一切: 在这里: 没有成功

更新:我还尝试了下面介绍的甜甜圈缓存技术:

我注意到,对于可以工作的页面,如果在
MiniProfiler.Start()
上的
Application\u BeginRequest
中有一个断点,
MiniProfiler.Current
对我们大多数页面的on请求都有一个值,但是对于我们的登录页面的请求,它在此时是空的。登录页似乎没有任何会导致问题的特殊之处

我的代码的重要部分如下所示

Global.asax.cs:

protected void Application_BeginRequest(Object sender, EventArgs e)
    {
        if (Request.IsLocal)
        {
            MiniProfiler.Start();
        }


    }

protected void Application_EndRequest()
    {             

        MiniProfiler.Stop(discardResults: false);

    }
Web.config:


这是我的答案

最后,请确保在应用程序_Start()中添加了代码


参见官方文件:

这很有趣。如果您在MiniProfiler.Start()上找到一个断点,它是否适合这些页面?这是否可能是[OutputCache]问题?回答是因为我在同一个团队中-是的,它在所有情况下都会命中MiniProfiler.Start(),但就在这一页之后,MiniProfiler.Current仍然为空。我会调查[输出缓存]的事情,不是吗idea@MarcGravell我不认为它是一个[OutputCache]的东西,因为我们不为登录页涉及的任何函数调用它。但问题听起来确实可能与此类似。
protected void Application_Start()
{
    ...
    MiniProfiler.Configure(new MiniProfilerOptions());//default setting
    MiniProfilerEF6.Initialize();
}