How to access built in UI for Mini Profiler and without Cassette throwing InvalidDataException regarding GZip header?


#1

I am trying to access the built-in UI for Mini Profiler, but it either does nothing or Cassette gets in the way throwing an exception.

With Cassette url rewriting enabled, I encounter this error when browsing to “~/mini-profiler-resources/results-index”:

[InvalidDataException: The magic number in GZip header is not correct. Make sure you are passing in a GZip stream.]
   System.IO.Compression.GZipDecoder.ReadHeader(InputBuffer input) +8662842
   System.IO.Compression.Inflater.Decode() +560
   System.IO.Compression.Inflater.Inflate(Byte[] bytes, Int32 offset, Int32 length) +118
   System.IO.Compression.DeflateStream.Read(Byte[] array, Int32 offset, Int32 count) +85
   System.IO.Compression.GZipStream.Read(Byte[] array, Int32 offset, Int32 count) +33
   System.IO.Stream.InternalCopyTo(Stream destination, Int32 bufferSize) +62
   Cassette.Aspnet.PlaceholderReplacingResponseFilter.WriteCompressedOutput(Func`3 createCompressionStream) +136
   Cassette.Aspnet.PlaceholderReplacingResponseFilter.Close() +24
   System.Web.HttpWriter.FilterIntegrated(Boolean finalFiltering, IIS7WorkerRequest wr) +12599767
   System.Web.HttpResponse.FilterOutput() +121
   System.Web.CallFilterExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +119
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +165

I don’t have any other compression services running (which could be a problem if it was in place and url rewriting was on). If I disable url rewriting in Cassette, there is no error and I see this in the emitted HTML, but nothing is displayed:

<html><head>
<title>List of profiling sessions</title>
<script id='mini-profiler' data-ids='' type='text/javascript' src='/mini-profiler-resources/includes.js?v=kpfJeIOqwihzCDVVKMPIcBwCBaKk3jhX5Le1VL+KMf4='></script>
<link href='/mini-profiler-resources/includes.css?v=kpfJeIOqwihzCDVVKMPIcBwCBaKk3jhX5Le1VL+KMf4=' rel='stylesheet' type='text/css'>
<script type='text/javascript'>MiniProfiler.list.init({path: '/mini-profiler-resources/', version: 'kpfJeIOqwihzCDVVKMPIcBwCBaKk3jhX5Le1VL+KMf4='})</script>
</head><body></body></html>

I am using SqlServerStorage and so I can see timings emitted to the database and I can see the popup timings UI on any given page. Here is my initialization done in Application_Start():

MiniProfiler.Settings.Storage = new SqlServerStorage(ConfigurationManager.ConnectionStrings[Shared.Constants.ConnectionStrings.MiniProfiler].ConnectionString);
            MiniProfilerEF.Initialize();
	        MiniProfiler.Settings.PopupStartHidden = true;
            MiniProfiler.Settings.PopupRenderPosition = RenderPosition.BottomLeft;
            MiniProfiler.Settings.Results_Authorize = httpRequest => true;
            MiniProfiler.Settings.Results_List_Authorize = httpRequest => true;

I added this to web.config:

<add name="MiniProfiler" path="mini-profiler-resources/*" verb="*" type="System.Web.Routing.UrlRoutingModule" resourceType="Unspecified" preCondition="integratedMode" />

I am using the following package versions:

  • MiniProfiler.3.0.10-beta6
  • MiniProfiler.EF5.3.0.10-beta1
  • MiniProfiler.Mvc4.3.0.10-beta1

Platform is .NET, C#, MVC4, ASP.NET, IIS7, etc.

Any ideas on what might be wrong with my setup or what is going on with Cassette? It might be obvious as I am new to MiniProfiler. I am going to look into writing a plugin that strips the url rewrite for anything going to the miniprofiler url “mini-profiler-resources” so that might be what I have to do.

Thanks for the consideration.

Rob