我已经添加
Mini Profiler到
NuGet,虽然在一个非常简单的项目工程可爱,这是一个大而现存的项目,当然,我有一些问题:
<link rel="stylesheet" type="text/css" href="/mini-profiler-includes.css?v=1.9.0.0"> <script type="text/javascript"> if (!window.jQuery) document.write(unescape("%3Cscript src='/mini-profiler-jquery.1.6.2.js' type='text/javascript'%3E%3C/script%3E")); if (!window.jQuery || !window.jQuery.tmpl) document.write(unescape("%3Cscript src='/mini-profiler-jquery.tmpl.beta1.js' type='text/javascript'%3E%3C/script%3E")); </script> <script type="text/javascript" src="/mini-profiler-includes.js?v=1.9.0.0"></script> <script type="text/javascript"> jQuery(function() { MiniProfiler.init({ ids: ["e48fcf61-41b0-42e8-935a-fbb1965fc780","870a92db-89bc-4b28-a410-9064d6e578df","30881949-bfdb-4e3a-9ea5-6d4b73c28c1d","6bca31b8-69d9-48eb-b86e-032f4d75f646","df16838d-b569-47d0-93e6-259c03322394"],path: '/',version: '1.9.0.0',renderPosition: 'left',showTrivial: false,showChildrenTime: false,maxTracesToShow: 15 }); }); </script>
我验证了在App_Start下有一个MiniProfiler.cs,并在其中添加了一个断点,代码运行,我甚至添加
#region Mini Profiler protected void Application_BeginRequest() { if (Request.IsLocal) { MiniProfiler.Start(); } } protected void Application_EndRequest() { MiniProfiler.Stop(); } #endregion
到global.asax文件…
Is there something obvIoUsly that I’m missing?
解决方法
这是IIS的某些配置的已知问题.
解决方法是确保UrlRoutingModule处理您的web.config中包含的所有迷你分析器:
<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>
目前有两张这个问题的公开机票:
> http://code.google.com/p/mvc-mini-profiler/issues/detail?id=50
> http://code.google.com/p/mvc-mini-profiler/issues/detail?id=60
在未来的版本中,为避免这个问题,我们可能会为我们的包含扩展服务.