I am trying to use a mini profiler with WCF. I keep getting 404 error:
http:
Results are not returned.
I use two versions of the mini profiler. The NUGET version, which does not include WCF support, works great.
I downloaded the git version to use WCF integration. I note that if I run a test project included in the source "Sample.Mvc", then the same error occurs when the home page is executed, but not for some links. It seems I canβt get the results on any of my own website pages. The same 404 happens.
I downloaded the main version. I am using .NET 4.0 and studio 2010.
In the configuration file, I have the following: I tried with and without handlers.
<system.webServer> <validation validateIntegratedModeConfiguration="false" /> <modules runAllManagedModulesForAllRequests="true" /> <handlers> <add name="MiniProfiler" path="mini-profiler-resources/*" verb="*" type="System.Web.Routing.UrlRoutingModule" resourceType="Unspecified" preCondition="integratedMode" /> </handlers> </system.webServer>
I definitely call start and stop methods.
StackExchange.Profiling.MiniProfiler.Stop();
I read the following: MvcMiniProfiler result query giving 404 in an ASP.NET MVC application
It did not help.
I found the key to the problem
The following code in the miniprofile returns NotFound. The profiler expects that some indicative value is present, and this is not so.
private static string Results(HttpContext context) { // this guid is the MiniProfiler.Id property Guid id; if (!Guid.TryParse(context.Request["id"], out id)) return isPopup ? NotFound(context) : NotFound(context, "text/plain", "No Guid id specified on the query string");
interim fix
I took out the code above and simply collected the first pointer to storage, and this fixed the problem. I think this code needs to be cleaned up. I need to learn GIT and then try and clean myself.
var id = MiniProfiler.Settings.Storage.List(10).FirstOrDefault();