6

ASP.Net 4 框架上的 MVC 2 项目。我试图在 IIS7 上设置它,它给了我一个 403.14 错误。

是的,我尝试了 microsoft fix,它启用了目录浏览,这完全是我想要做的错误的事情。

是的,我跑了 aspnet_regiis -i

不,它仍然无法正常工作

我也尝试重新安装.net 4,仍然没有。

我有点怀疑它可能是网站本身的东西,因为其他 .Net 项目将在同一个 IIS 上运行。我唯一能想到的是它是我的 .config 文件,我将在下面粘贴:

<?xml version="1.0"?>
<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=152368
  -->
<configuration>
  <configSections>
    <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" />
  </configSections>
  <appSettings configSource="AppSettings.config"/>

  <connectionStrings configSource="ConnectionStrings.config" />
  <system.net>
    <mailSettings>
      <smtp configSource="Smtp.config" />
    </mailSettings>
  </system.net>
  <system.web>
    <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" />
      </assemblies>
    </compilation>
    <authentication mode="Forms">
      <forms loginUrl="~/Security/AccessDenied" timeout="2880" />
    </authentication>
    <roleManager enabled="true" cacheRolesInCookie="false" defaultProvider="RoleProvider">
      <providers>
        <clear />
        <add name="RoleProvider" type="Boeing.Gls.Lpm.Web.Providers.LpmRoleProvider" />
      </providers>
    </roleManager>
    <customErrors mode="Off" defaultRedirect="Error.aspx">
      <error statusCode="404" redirect="Lpm/NotFound" />
    </customErrors>
    <pages>
      <namespaces>
        <add namespace="System.Web.Mvc" />
        <add namespace="System.Web.Mvc.Ajax" />
        <add namespace="System.Web.Mvc.Html" />
        <add namespace="System.Web.Routing" />
        <add namespace="Boeing.Gls.Lpm.Web.Models" />
        <add namespace="Boeing.Gls.Lpm.Domain.DataContracts" />
      </namespaces>
    </pages>
    <httpRuntime requestValidationMode="2.0" />
  </system.web>
  <system.webServer>
    <modules runAllManagedModulesForAllRequests="false" />
  </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>
  <log4net debug="false">
    <!-- Define some output appenders -->
    <appender name="trace" type="log4net.Appender.TraceAppender, log4net">
      <layout type="log4net.Layout.PatternLayout,log4net">
        <param name="ConversionPattern" value="%d [%t] %-5p %c - %m%n" />
      </layout>
    </appender>
    <appender name="console" type="log4net.Appender.ConsoleAppender, log4net">
      <layout type="log4net.Layout.PatternLayout,log4net">
        <param name="ConversionPattern" value="%d [%t] [BemsId : %property{bemsid}] %-5p %c - %m%n" />
      </layout>
    </appender>
    <appender name="rollingFile" type="log4net.Appender.RollingFileAppender,log4net">
      <param name="File" value="App_Data/Log.txt" />
      <param name="AppendToFile" value="true" />
      <param name="RollingStyle" value="Date" />
      <param name="DatePattern" value="yyyy.MM.dd" />
      <param name="StaticLogFileName" value="true" />
      <layout type="log4net.Layout.PatternLayout,log4net">
        <param name="ConversionPattern" value="%d [%t] %-5p %c - %m%n" />
      </layout>
    </appender>
    <logger name="NHibernate">
      <level value="ERROR" />
    </logger>
    <root>
      <priority value="DEBUG" />
      <appender-ref ref="rollingFile" />
    </root>
  </log4net>
</configuration>

有任何想法吗?

4

1 回答 1

9

尝试设置runAllManagedModulesForAllRequests="true"

<system.webServer>
    <modules runAllManagedModulesForAllRequests="true" />
</system.webServer>
于 2010-12-31T02:33:32.757 回答