Glimpse图标不会出现

时间:2013-04-02 19:49:30

标签: asp.net-mvc-4 glimpse

我正在尝试使用Glimpse for MVC 4.我的问题是,虽然我已经关注了installation instructions on the Glimpse site,但我的网站上并没有出现Glimpse图标。

基本上我创建了一个新的MVC 4项目并添加了NuGet包Glimpse.MVC4。这是我的web.config文件:

<?xml version="1.0" encoding="utf-8"?>
<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=169433
  -->
<configuration>
  <configSections>
    <section name="glimpse" type="Glimpse.Core.Configuration.Section, Glimpse.Core" />
  </configSections>
  <appSettings>
    <add key="webpages:Version" value="2.0.0.0" />
    <add key="webpages:Enabled" value="false" />
    <add key="PreserveLoginUrl" value="true" />
    <add key="ClientValidationEnabled" value="true" />
    <add key="UnobtrusiveJavaScriptEnabled" value="true" />
  </appSettings>
  <system.web>
    <httpRuntime targetFramework="4.5" />
    <compilation debug="true" targetFramework="4.5" />
    <pages>
      <namespaces>
        <add namespace="System.Web.Helpers" />
        <add namespace="System.Web.Mvc" />
        <add namespace="System.Web.Mvc.Ajax" />
        <add namespace="System.Web.Mvc.Html" />
        <add namespace="System.Web.Routing" />
        <add namespace="System.Web.WebPages" />
      </namespaces>
    </pages>
    <!-- Glimpse: This can be commented in to add additional data to the Trace tab when using WebForms
        <trace writeToDiagnosticsTrace="true" enabled="true" pageOutput="false"/> -->
    <httpModules>
      <add name="Glimpse" type="Glimpse.AspNet.HttpModule, Glimpse.AspNet" />
    </httpModules>
    <httpHandlers>
      <add path="glimpse.axd" verb="GET" type="Glimpse.AspNet.HttpHandler, Glimpse.AspNet" />
    </httpHandlers>
  </system.web>
  <system.webServer>
    <handlers>
      <remove name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" />
      <remove name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" />
      <remove name="ExtensionlessUrlHandler-Integrated-4.0" />
      <add name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" />
      <add name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" />
      <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
      <add name="Glimpse" path="glimpse.axd" verb="GET" type="Glimpse.AspNet.HttpHandler, Glimpse.AspNet" preCondition="integratedMode" />
    </handlers>
    <validation validateIntegratedModeConfiguration="false" />
    <modules>
      <add name="Glimpse" type="Glimpse.AspNet.HttpModule, Glimpse.AspNet" preCondition="integratedMode" />
    </modules>
  </system.webServer>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
  <glimpse defaultRuntimePolicy="On" endpointBaseUri="~/Glimpse.axd">
    <!-- If you are having issues with Glimpse, please include this. It will help us figure out whats going on. -->
      <logging level="Trace" />
  </glimpse>
</configuration>

当我运行自己的网站时,我会导航至http://localhost:12345/glimpse.axd,然后点击Turn On Glimpse按钮,该按钮会在我的网站上创建一个Cookie(我通过Chrome开发人员工具栏查看)。当我导航回http://12345时,我没有看到页面右下方出现任何图标,如说明中所述。

我已经查看了有关此方案的各种StackOverflow问题,但很多时候提到了旧的/Glimpse/Config方式。由于我没有做任何与众不同的事情,我想知道我是否只是错过了一步?

编辑:

嗯,我没有注意到我打开了伐木。好的,现在情况更清楚了:

2013-04-02 21:42:09.5624 | DEBUG | get_Binders method of type 'System.Web.Mvc.Async.AsyncControllerActionInvoker' is not proxyable. | 
    2013-04-02 21:42:09.5624 | DEBUG | set_Binders method of type 'System.Web.Mvc.Async.AsyncControllerActionInvoker' is not proxyable. | 
    2013-04-02 21:42:09.5624 | DEBUG | Methods inspected via proxy generation hook on type 'System.Web.Mvc.Async.AsyncControllerActionInvoker'. | 
    2013-04-02 21:42:09.6064 | DEBUG | Methods inspected via proxy generation hook on type 'System.Web.Mvc.IActionFilter'. | 
    2013-04-02 21:42:09.6064 | DEBUG | Methods inspected via proxy generation hook on type 'System.Web.Mvc.IResultFilter'. | 
    2013-04-02 21:42:09.6064 | DEBUG | Methods inspected via proxy generation hook on type 'System.Web.Mvc.IAuthorizationFilter'. | 
    2013-04-02 21:42:09.6064 | DEBUG | Methods inspected via proxy generation hook on type 'System.Web.Mvc.IExceptionFilter'. | 
    2013-04-02 21:42:09.6064 | DEBUG | Methods inspected via proxy generation hook on type 'System.Web.Mvc.IExceptionFilter'. | 
    2013-04-02 21:42:09.6364 | DEBUG | Methods inspected via proxy generation hook on type 'System.Web.Mvc.IValueProvider'. | 
    2013-04-02 21:42:09.6364 | DEBUG | Methods inspected via proxy generation hook on type 'System.Web.Mvc.IUnvalidatedValueProvider'. | 
    2013-04-02 21:42:09.6364 | DEBUG | Methods inspected via proxy generation hook on type 'System.Web.Mvc.IValueProvider'. | 
    2013-04-02 21:42:09.6364 | DEBUG | Methods inspected via proxy generation hook on type 'System.Web.Mvc.IUnvalidatedValueProvider'. | 
    2013-04-02 21:42:09.6504 | DEBUG | Methods inspected via proxy generation hook on type 'System.Web.Mvc.IValueProvider'. | 
    2013-04-02 21:42:10.0504 | DEBUG | Methods inspected via proxy generation hook on type 'System.Web.Mvc.IView'. | 
    2013-04-02 21:42:10.0504 | INFO | Replaced IView of type 'System.Web.Mvc.RazorView', named 'Index', with proxy implementation. | 
    2013-04-02 21:42:10.2524 | WARN | Unable to locate '</body>' with content encoding 'Unicode (UTF-8)'. Response may be compressed. | 
    2013-04-02 21:42:13.6916 | DEBUG | RuntimePolicy set to 'ExecuteResourceOnly' by IRuntimePolicy of type 'Glimpse.Core.Policy.GlimpseResourcePolicy' during RuntimeEvent 'ExecuteResource'. | 
    2013-04-02 21:42:15.0587 | DEBUG | RuntimePolicy set to 'ExecuteResourceOnly' by IRuntimePolicy of type 'Glimpse.Core.Policy.GlimpseResourcePolicy' during RuntimeEvent 'ExecuteResource'. | 
    2013-04-02 21:42:17.4918 | INFO | Replaced IView of type 'System.Web.Mvc.RazorView', named 'Index', with proxy implementation. | 
    2013-04-02 21:42:17.4918 | WARN | Unable to locate '</body>' with content encoding 'Unicode (UTF-8)'. Response may be compressed. | 

1 个答案:

答案 0 :(得分:3)

我只是在HTML中缺少<body>标记。添加缺失标签后,图标就会出现。