mishrsud / mvc-mini-profiler

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

RenderIncludes() assumes that the application is running on the website root, subdirectories don't work. #3

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I'm running a site in a directory, so:

 www.site.com/myapp

The problem is with:

 <%: MvcMiniProfiler.MiniProfiler.RenderIncludes() %>

As it outputs this:

 <link rel="stylesheet/less" type="text/css" href="/mini-profiler-includes.less?v=2.0.4177.17902">
 <script type="text/javascript" src="/mini-profiler-includes.js?v=2.0.4177.17902"></script>
 <script type="text/javascript"> jQuery(function() { MiniProfiler.init({ id:'b357465a-96ad-4a1e-9496-b4e146985111', renderDirection:'left' }); } ); </script>

The problem is that "/" goes to the site root, so "/mini-profiler-includes.js" 
becomes "www.site.com/mini-profiler-includes.js", which is not found.

I need it to be "www.site.com/myapp/mini-profiler-includes.js"

I would expect the RenderIncludes() to output:

 <link rel="stylesheet/less" type="text/css" href="/myapp/mini-profiler-includes.less?v=2.0.4177.17902">
 <script type="text/javascript" src="/myapp/mini-profiler-includes.js?v=2.0.4177.17902"></script>
 <script type="text/javascript"> jQuery(function() { MiniProfiler.init({ id:'b357465a-96ad-4a1e-9496-b4e146985111', renderDirection:'left' }); } ); </script>

Original issue reported on code.google.com by keithhe...@gmail.com on 9 Jun 2011 at 3:19

GoogleCodeExporter commented 8 years ago

Original comment by jarrod.m.dixon on 9 Jun 2011 at 10:41

GoogleCodeExporter commented 8 years ago
If I fix that I get further related errors:

MiniProfiler/UI/Includes.js line 11:
 $.get('/mini-profiler-results?id=' + id + '&popup=1', function(html) {

And - MiniProfiler/UI/MiniProfilerResults.cshtml line 59
 <a class="name" href="/mini-profiler-results?id=@p.Id" target="_blank">@e(p.Name)</a>

Original comment by keithhe...@gmail.com on 10 Jun 2011 at 7:35

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
I just pushed a changeset for this, the profiler should work correctly under 
virtual directories as well - all the paths are now relative to the application 
path.  

The mvc sample app was also updated with relative paths, so it can now be 
tested as a root or nested application.

Original comment by nrcraver on 10 Jun 2011 at 2:34

GoogleCodeExporter commented 8 years ago
Cheers :)

Original comment by keithhe...@gmail.com on 10 Jun 2011 at 2:43