MiniProfiler.Stop()上的MVC Mini Profiler异常

[英]MVC Mini Profiler Exception on MiniProfiler.Stop()


I'm just added Mini Profiler to my MVC3 project with nuget and I've followed the basic steps to get it set up. Starting the profile on Application_BeginRequest() and stopping it on Application_EndRequest()

我刚刚使用nuget将Mini Profiler添加到我的MVC3项目中,我已按照基本步骤进行设置。在Application_BeginRequest()上启动配置文件并在Application_EndRequest()上停止它

    protected void Application_BeginRequest()
    {
        if (Request.IsLocal)
        {
            MiniProfiler.Start();
        }

    }

    protected void Application_EndRequest()
    {
        MiniProfiler.Stop();
    }

MiniProfiler.Stop() is throwing an exception - "Server cannot append header after HTTP headers have been sent."

MiniProfiler.Stop()抛出异常 - “在发送HTTP标头后,服务器无法追加标头。”

Has anybody else seen this?

有没有人见过这个?

2 个解决方案

#1


7  

Old question but answering anyway.

老问题,但无论如何回答。

Problem caused by some component (SignalR in my case) calls HttpResponse.Flush. Solved by excluding SignalR from profiling. Below is a simple version of what we have done.

某些组件引起的问题(在我的情况下是SignalR)调用HttpResponse.Flush。通过从分析中排除SignalR来解决。以下是我们所做的简单版本。

if (Request.IsLocal && !Request.Path.StartsWith("/signalr"))
{
    MiniProfiler.Start();
}

Hope it helps.

希望能帮助到你。

#2


1  

This appears to be related to Combres (http://combres.codeplex.com/). If I ignore the requests for my js and css that has been combined and compressed with combres the profiler seems to work better (no exception being thrown)

这似乎与Combres(http://combres.codeplex.com/)有关。如果我忽略了我的js和css的请求已被合并并使用combres压缩,则分析器似乎工作得更好(没有异常被抛出)


注意!

本站翻译的文章,版权归属于本站,未经许可禁止转摘,转摘请注明本文地址:http://www.itdaan.com/blog/2011/07/23/26bed3ac016a490cc12c6cb9b508b8c6.html



 
© 2014-2018 ITdaan.com 粤ICP备14056181号