Just started using MiniProfiler in a .NET 4.0 MVC3 app with EF5, and generally love it. It works well, and is valuable.
However, occasionally (seems like it’s most often right after starting a fresh build) the request will take a long time, then an InvalidOperationException will be thrown. After continuing past the exception everything seems okay, and re-requesting the same page works quickly and without error.
MiniProfiler was added to the project through NuGet, which reports version 3.1.1.140 for MiniProfiler
Exception message: “Error during serialization or deserialization using the JSON JavaScriptSerializer. The length of the string exceeds the value set on the maxJsonLength property.”
Inner Exception: null
Stack Trace:
at System.Web.Script.Serialization.JavaScriptSerializer.Serialize(Object obj, StringBuilder output, SerializationFormat serializationFormat)
at System.Web.Script.Serialization.JavaScriptSerializer.Serialize(Object obj, SerializationFormat serializationFormat)
at System.Web.Script.Serialization.JavaScriptSerializer.Serialize(Object obj)
at StackExchange.Profiling.MiniProfiler.ToJson(MiniProfiler profiler) in c:\TeamCity\buildAgent\work\1de24adb938b932d\StackExchange.Profiling\MiniProfiler.cs:line 349
at StackExchange.Profiling.MiniProfilerHandler.ResultsJson(HttpContext context, MiniProfiler profiler) in c:\TeamCity\buildAgent\work\1de24adb938b932d\StackExchange.Profiling\MiniProfilerHandler.cs:line 349
at StackExchange.Profiling.MiniProfilerHandler.GetSingleProfilerResult(HttpContext context) in c:\TeamCity\buildAgent\work\1de24adb938b932d\StackExchange.Profiling\MiniProfilerHandler.cs:line 343
at StackExchange.Profiling.MiniProfilerHandler.ProcessRequest(HttpContext context) in c:\TeamCity\buildAgent\work\1de24adb938b932d\StackExchange.Profiling\MiniProfilerHandler.cs:line 93
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)