Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"profiler/results" not found on production #624

Open
Ninashka opened this issue Oct 12, 2022 · 2 comments
Open

"profiler/results" not found on production #624

Ninashka opened this issue Oct 12, 2022 · 2 comments

Comments

@Ninashka
Copy link

Ninashka commented Oct 12, 2022

To use miniprofiler in an MVC 5 application, I have followed all the steps mentioned here:
MiniProfiler for .NET

with a difference in Global.aspx

protected void Application_Start()
{
      MiniProfiler.Configure(new MiniProfilerOptions
      {              
        Storage = new MemoryCacheStorage( new System.TimeSpan(1,0,0) ),
        ResultsAuthorize = request => {return true;},
        
        // The rest of the options go here
        .
        .
       }
        .AddViewProfiling()            
      );
}


protected void Application_BeginRequest()
{
      // For all requests, not only local
      MiniProfiler.StartNew();
}

It works locally, but not when deployed on IIS. I get 404 not found error for "profiler/results", and when I navigate to "profiler/results-index" I get an empty table with headers only.

@NickCraver
Copy link
Member

Can you paste the section of your web.config? My only guess here is they're not running in all cases, though I'm puzzled that you get a results list at all. Is it possible you're never stopping the profilers to save them? e.g. in the docs:

protected void Application_EndRequest()
{
    MiniProfiler.Current?.Stop(); // Be sure to stop the profiler!
}

@Ninashka
Copy link
Author

Ninashka commented Oct 30, 2022

Hi, here is the section of my config:

<system.webServer>
<modules runAllManagedModulesForAllRequests="true" />

<handlers>

  <remove name="ExtensionlessUrlHandler-Integrated-4.0" />
  <remove name="OPTIONSVerbHandler" />
  <remove name="TRACEVerbHandler" />

  <add name="MiniProfiler" path="profiler/*" verb="*" type="System.Web.Routing.UrlRoutingModule" resourceType="Unspecified" preCondition="integratedMode" />
  
 <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />

  
</handlers>

<httpErrors errorMode="Detailed" existingResponse="Replace">
  <remove statusCode="404" />
  <error statusCode="404" path="404.html" responseMode="File" />
  <remove statusCode="500" />
  <error statusCode="500" path="500.html" responseMode="File" />
</httpErrors>
</system.webServer>

And, yes, I am stopping the profiler in Application_EndRequest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants