我正在尝试使用MVC4的Glimpse。我的问题是,尽管我关注了installation instructions on the Glimpse site,但Glimpse图标并没有出现在我的网站上。
基本上,我创建了一个新的MVC4项目并添加了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并点击cookie按钮,这会在我的网站上创建一个cookie(我通过Chrome developer工具栏看到)。当我导航回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. | 发布于 2013-04-03 04:45:48
我只是在超文本标记语言中遗漏了一个<body>标签。一旦我添加了缺少的标签,图标就会出现。
https://stackoverflow.com/questions/15773083
复制相似问题