我厌倦了使用MiniProfiler上的HowTo来安装http://miniprofiler.com/
这似乎是可行的:
<%= StackExchange.Profiling.MiniProfiler.RenderIncludes() %>但是,当我启动该站点时,我会收到以下错误消息:
'MiniProfiler' is undefined问题在包含的MiniProfiler代码中:
var initMp = function(){
load('/mini-profiler-resources/includes.js?v=6cJT7lsVkH6SxAlFpQstk1/AgtUwMUApXN3pviVvaRE=',function(){
MiniProfiler.init({.....当我尝试用IE打开http://localhost/mini-profiler-resources/includes.js?v=6cJT7lsVkH6SxAlFpQstk1/AgtUwMUApXN3pviVvaRE=时,我得到了404。
我甚至尝试过这个解决方案 found on stackoverflow,但它对我不起作用:
有没有人知道这个问题,或者知道我能做些什么来解决这个问题?
溶液
我通过添加this解决方案中的配置部分和"runAllManagedModulesForAllRequests“行解决了这个问题:
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
<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>“诀窍”是在下面添加一行,以使处理程序正常工作。
<modules runAllManagedModulesForAllRequests="true"/>发布于 2014-02-15 20:58:54
通过将以下内容添加到主web.config文件中,您应该能够更简洁地避免这个问题(一行处理程序而不是三行):
<system.webServer>
...
<handlers>
<add name="MiniProfiler" path="mini-profiler-resources/*" verb="*" type="System.Web.Routing.UrlRoutingModule" resourceType="Unspecified" preCondition="integratedMode" />
</handlers>
</system.webServer>https://stackoverflow.com/questions/11505470
复制相似问题