WCF Mini Profiler

I am trying to use a mini profiler with WCF. I keep getting 404 error:

http://website/mini-profiler-resources/results 

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(); 
+4
source share
1 answer

Do you see ... / mini -profiler-resources / results-index?

A handler is not required by the way. There is a comma in your link, but suppose it's just a typo issue.

You call the last thing in Application_BeginRequest() and stop at Application_EndRequest()

Have you GlobalFilters.Filters.Add(new ProfilingActionFilter()); ?

and you use WebActivator with MiniProfilerPackage and MiniProfilerStartupModule

I think I need to remove my own implementation, because it looks like I have an extra jerk.

+2
source

Source: https://habr.com/ru/post/1439129/


All Articles