akyazilim / mvc-mini-profiler

Automatically exported from code.google.com/p/mvc-mini-profiler
0 stars 0 forks source link

Not working under IIS #50

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Setup sample.mvc to run under IIS
2. Navigate to page
3. No Profiler widget

What is the expected output? What do you see instead?

What version of the product are you using? On what operating system?
1.4.4195.37960

Please provide any additional information below.
for js and css files, it seems the IHttpHandler is well returned by 
MiniProfilerHanlder (return this;) but the ProcessRequest is never called

Original issue reported on code.google.com by vdesm...@gmail.com on 2 Jul 2011 at 7:18

GoogleCodeExporter commented 8 years ago
I've set up both the Sample.Mvc and Sample.WebForms projects as new sites 
(mapped in hosts) to run under IIS 7.5 in Win7 SP1. Both app pools are running 
under .NET Framework v4.0.30319.

I'm not having any issues with seeing profiler results - what OS are you 
deploying to?  

We're also not seeing any issues with our deployment on Stack Overflow, which 
is on Windows Server 2008 R2.

Original comment by jarrod.m.dixon on 4 Jul 2011 at 7:04

GoogleCodeExporter commented 8 years ago
I'm using Win 7 64 bit with SP1.  The IIS Pool is configured with Integrated 
Pipeline and PoolIdentity. The site works but the top left dic never shows :  
here is the header of the coming page :

<head>
    <title>Home Page - MVC MiniProfiler Demo</title>
    <link href="/Content/Site.css" rel="stylesheet" type="text/css" />
    <script src="/Scripts/jquery-1.5.1.min.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" 
href="/profiler/mini-profiler-includes.css?v=1.4.4210.18825">
<script type="text/javascript" 
src="/profiler/mini-profiler-yepnope.1.0.1.js"></script>
<script type="text/javascript">
    yepnope([
        { test: window.jQuery, nope: '/profiler/mini-profiler-jquery.1.6.1.js' },
        { test: window.jQuery && window.jQuery.tmpl, nope: '/profiler/mini-profiler-jquery.tmpl.beta1.js' },
        { load: '/profiler/mini-profiler-includes.js?v=1.4.4210.18825',
           complete: function() {
               jQuery(function() {
                   MiniProfiler.init({
                       ids: ["97f819e6-17c4-49e1-9142-0203b367e409","468cbb15-f733-42cc-a197-9c51f2c819f9"],
                       path: '/profiler/',
                       version: '1.4.4210.18825',
                       renderPosition: 'left',
                       showTrivial: false,
                       showChildrenTime: false,
                       maxTracesToShow: 10
                   });
               });
         }
    }]);
</script></head>

Original comment by vdesm...@gmail.com on 12 Jul 2011 at 9:37

GoogleCodeExporter commented 8 years ago
first problem is that when /profiler/mini-profiler-yepnope.1.0.1.js is 
requested, the MvcMiniProfilerHander's GetHttpHandler returns this (elegant 
indeed ;-)) but the ProcessRequest method is never called !

Original comment by vdesm...@gmail.com on 12 Jul 2011 at 10:02

GoogleCodeExporter commented 8 years ago
Ho, btw, I had to setup the pool to use 32bit otherwise the 
'System.Data.SQLite'  could not be loaded.

Original comment by vdesm...@gmail.com on 12 Jul 2011 at 10:04

GoogleCodeExporter commented 8 years ago
You have to add something like this:

<system.webServer>
    <handlers>
        <add name="UrlRoutingModule1" path="mini-profiler*.js" verb="*" type="System.Web.Routing.UrlRoutingModule" resourceType="Unspecified" preCondition="integratedMode" />
        <add name="UrlRoutingModule2" path="mini-profiler*.css" verb="*" type="System.Web.Routing.UrlRoutingModule" resourceType="Unspecified" preCondition="integratedMode" />
        <add name="UrlRoutingModule3" path="mini-profiler*.tmpl" verb="*" type="System.Web.Routing.UrlRoutingModule" resourceType="Unspecified" preCondition="integratedMode" />
    </handlers>
</system.webServer>

in your web.config to get it works.
The problem is that files like *.js, *.css are handled by Static Handler in IIS 
by default.
We need the specific files like "mini-profiler-jquery.1.6.1.js" to be handled 
by System.Web.Routing.UrlRoutingModule to be able ASP.NET Routing to process 
the request.

Original comment by Peta...@gmail.com on 1 Sep 2011 at 9:06

GoogleCodeExporter commented 8 years ago
This is tricky to implement, I would am open to a patch, but we can not leave 
this open forever. 

Original comment by sam.saff...@gmail.com on 14 Feb 2012 at 4:16

GoogleCodeExporter commented 8 years ago
Latest version 
(https://code.google.com/p/mvc-mini-profiler/source/detail?r=ec9ad4ff996ed2e1e22
5c5a223ad93445224ad12) works great on my dev machine (iis 7, integrated mode), 
but when ever i move my code to my hosting site (iis 7, classic mode - i can't 
change this) i stops working by giving an 404 error. 
I've tried the UrlRouting in comment 4 above, and also tried adding wildcard 
matching on server side, but still not working.

I solved it by copying the *.js, *.css and *.tmpl files from the miniprofiler 
source code to a physical directory called "mini-profiler-resources" on the 
server, and it worked. I just had to add a mime type for the *.tmpl files, and 
it worked.
<system.webServer>
    <staticContent>
        <mimeMap fileExtension=".tmpl" mimeType="text/plain" />
    </staticContent>
</system.webServer>

It's working for me now, but have i made an error doing it like this?

/johan

Original comment by johan.sa...@gmail.com on 16 Feb 2012 at 2:00

GoogleCodeExporter commented 8 years ago
I am having the same issue.  Can't get this to work on x64 2008 iis 7.5.  
Hopeful that once the 2.0 version makes it to nuget it fixes my issues.  I have 
tried the above web.config entries.

Original comment by trenton....@gmail.com on 22 Feb 2012 at 3:37