【发布时间】:2010-11-10 21:58:14
【问题描述】:
我的 ASP.NET MVC 2 应用程序有一点奇怪的行为。
我正在使用 IIS 7.5、Windows 身份验证和 ASP.NET 模拟来加载我的网页。
经过多次搜索,我没有找到摆脱每次页面加载时不断收到的 500.24 请求的好方法(根目录中的 favicon.ico 会触发此问题):
我看过一些文章,如 this one 或 that one 但这似乎并不能解决我的问题。我需要这些设置才能让我的应用程序在这里工作:.NET 4 Framework 集成模式管道、Windows 身份验证和 ASP.NET 模拟。
这是我的 web.config 的简化版本,如果它可以帮助任何人(当然,出于安全原因,我已经删除了连接字符串..)
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.web>
<customErrors mode="Off" />
<identity impersonate="true" />
<compilation debug="true" targetFramework="4.0">
<assemblies>
<add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<add assembly="System.Data.Entity.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</assemblies>
</compilation>
<authentication mode="Windows">
<!-- roleManager enabled="true" defaultProvider="AspNetWindowsTokenRoleProvider" / -->
<!-- forms loginUrl="~/Account/LogOn" timeout="2880" / -->
</authentication>
<membership>
<providers>
<clear />
<add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="ApplicationServices" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="/Globe" />
</providers>
</membership>
<profile>
<providers>
<clear />
<add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="/Globe" />
</providers>
</profile>
<roleManager enabled="false">
<providers>
<clear />
<add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="ApplicationServices" applicationName="/Globe" />
<add name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" applicationName="/Globe" />
</providers>
</roleManager>
<pages>
<namespaces>
<add namespace="System.Web.Mvc" />
<add namespace="System.Web.Mvc.Ajax" />
<add namespace="System.Web.Mvc.Html" />
<add namespace="System.Web.Routing" />
</namespaces>
</pages>
</system.web>
<system.webServer>
<httpProtocol>
<customHeaders>
<add name="X-UA-Compatible" value="IE=edge" />
</customHeaders>
</httpProtocol>
<validation validateIntegratedModeConfiguration="false" />
<modules runAllManagedModulesForAllRequests="true">
<remove name="WebDAVModule" />
</modules>
<security>
<requestFiltering>
<verbs>
<add verb="PUT" allowed="true" />
<add verb="DELETE" allowed="true" />
</verbs>
</requestFiltering>
</security>
</system.webServer>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0" newVersion="2.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
</system.serviceModel>
</configuration>
我的应用程序正在运行,favicon.ico 正在加载,我只是想知道为什么它会在每个请求上触发 500.24(当然,也许是 Fiddler 无法验证自己并导致 de 500.24 HTTP 错误,但是当它正常运行时,它会触发 401.2 - 未授权...)
【问题讨论】:
-
在网络上的快速建议看起来是它的模拟 = true。您是否尝试过转移到经典模式(许多链接建议)以查看它是否有效。因为我猜“
”对你不起作用 -
我不能使用经典模式,因为我的应用程序需要集成管道,并且
<identity impersonate="true" />和<validation validateIntegratedModeConfiguration="false" />都已在我的 web.config 中强制执行。
标签: iis asp.net-mvc-2 httprequest fiddler favicon