2010-11-10 74 views
0

我的ASP.NET MVC 2应用程序有点奇怪的行为。ASP.NET MVC 2&IIS:HTTP 500.24 favicon.ico错误

我正在使用IIS 7.5,Windows身份验证和ASP.NET模拟来加载我的网页。

经过几次的搜索,我没有找到一个很好的方式摆脱500.24要求我保持每天页面加载得到的(在根目录下的favicon.ico触发此):

Fiddler

我看过一些文章,如this onethat 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> 

我的应用程序工作时,图标.ico正在加载,我只是想知道为什么它会在每个请求中触发一个500.24(当然,也许是Fiddler不能对自身进行身份验证并导致de 500.24 HTTP错误,但是当它正常执行时会触发401.2 - 未经授权相反...)

+0

在网络上的快速建议看起来是它的模拟=真。您是否尝试过转移到经典模式(由许多链接建议)以查看它是否有效。因为我猜“”不适合你 – dbones 2010-11-10 22:23:07

+0

我不能使用经典模式,因为我的应用程序需要集成管道,并且'和<验证validateIntegratedModeConfiguration =“false”/>'已经在我的web.config中强制执行。 – LoganWolfer 2010-11-11 15:48:54

回答

2

我的猜测是,favicon.ico要么在不同的应用程序池中运行,要么在根目录中有一个web.config有问题的网站。 因此: 1)检查网站的根目录(/favicon.ico所在的目录)是否包含web.config。如果确实如此,请检查它是否正在设置system.web/httpModule,httpHandler或system.web/identity(impersonate)或类似的东西,并且应用程序池以集成模式运行。

所以你需要做的是要么删除有问题的HTTP模块/ HttpHandler的/冒充设置或更改应用程序池为经典跑,或添加相同的配置你的网站包括为<验证validateIntegratedModeConfiguration =“假”/>

+0

我会研究这个,但是我确实需要集成管道,并且''对我没有任何帮助。在C:\ inetpub \ wwwroot中确实有一个生成的web.config文件,我已经尝试在wwwroot web.config中添加'',但仍未做任何更改。 impersonate = true也位于wwwroot的web.config中。我怎样才能找出哪个httpmodule/httphandler导致这种情况?只有一个网站和一个应用程序,并且都使用相同的应用程序池。有任何想法吗 ? – LoganWolfer 2010-11-11 16:13:29

0

CarlosAg说了些什么。便宜的修复可能是将favicon移动到冒犯的应用程序中,而不是吠叫树。

0

我找到了答案,以我的问题=)

你会笑我,肯定.. = P

那么,答案的一部分,是在C <validation validateIntegratedModeConfiguration="false" />:\ CarlosAg指出的inetpub \ wwwroot,但另一部分是我忘了在我的ASP.NET MVC 2应用程序中将<link rel="icon" href="<%: Url.Content("~/favicon.ico")%>" type="image/x-icon" />添加到我的Site.Master文件中。由于Chrome和IE确实看到了favicon.ico的根目录,它似乎可行,但直到现在Firefox并没有加载收藏夹图标,我没有注意到。

现在,每个浏览器都加载了favicon,并且在Fiddler中没有发送500.24 HTTP请求。

谢谢! =)