2013-04-02 63 views
1

我正在尝试使用Glimpse进行MVC 4.我的问题是,虽然我遵循了installation instructions on the Glimpse site,但我的网站上没有出现Glimpse图标。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做事的方式。由于我没有做过任何不寻常的事情,我想知道我是否错过了一步?

编辑:

咦,我没有注意到我已经打开了记录。 OK,现在事情更清晰:

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

它看起来像你打开日志记录。你能分享正在创建的日志文件的内容吗? (它应该在您的网站的根目录中,名为Glimpse.log) – nikmd23

回答

3

我只是缺少了一个HTML标签<body>。一旦我添加了缺失标签,图标就会出现。