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

前端之家收集整理的这篇文章主要介绍了asp.net – MiniProfiler.Stop()上的MVC Mini Profiler异常前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我刚刚使用nuget将Mini Profiler添加到我的MVC3项目中,我已按照基本步骤进行设置.在Application_BeginRequest()上启动配置文件并在Application_EndRequest()上停止它 @H_403_2@protected void Application_BeginRequest() { if (Request.IsLocal) { MiniProfiler.Start(); } } protected void Application_EndRequest() { MiniProfiler.Stop(); }

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

有没有人见过这个?

解决方法

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

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

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

希望能帮助到你.

猜你在找的asp.Net相关文章