我刚刚使用 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() 抛出异常 - “发送 HTTP header 后,服务器无法附加 header 。”
有没有其他人看到这个?
最佳答案
老问题,但无论如何回答。
由某些组件引起的问题(在我的情况下为 SignalR
)调用 HttpResponse.Flush
.
通过排除 SignalR
解决从分析。下面是我们所做的一个简单版本。
if (Request.IsLocal && !Request.Path.StartsWith("/signalr"))
{
MiniProfiler.Start();
}
希望能帮助到你。
关于asp.net - MiniProfiler.Stop() 上的 MVC Mini Profiler 异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6798028/