【问题标题】:Error 403 - Forbidden: Access is denied. ASP.NET错误 403 - 禁止访问:访问被拒绝。 ASP.NET
【发布时间】:2019-01-31 02:52:38
【问题描述】:

这是我的网络配置文件。据我所知,我试图通过网上的信息来调整这个配置。但我的网站仍然错误 403。像这样:

403 - 禁止访问:访问被拒绝。 您无权使用您提供的凭据查看此目录或页面。

<?xml version="1.0"?>

<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=169433
  -->

<configuration>
    <system.web>
      <compilation debug="true" strict="false" explicit="true" targetFramework="4.5" />
      <httpRuntime targetFramework="4.5" />
<!-- new added code -->
     <authorization>
        <allow users="?"/>
     </authorization>
    <defaultDocument>
        <files>
            <add value="Home.aspx"/>
        </files>
    </defaultDocument>
<!-- new added code -->
    </system.web>

  <!-- NEW ADDED
        The system.webServer section is required for running ASP.NET AJAX under Internet
        Information Services 7.0.  It is not necessary for previous version of IIS.
    -->
  <system.webServer>
    <validation validateIntegratedModeConfiguration="false"/>
    <modules>
      <remove name="ScriptModule"/>
      <add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    </modules>
    <handlers>
      <remove name="WebServiceHandlerFactory-Integrated"/>
      <remove name="ScriptHandlerFactory"/>
      <remove name="ScriptHandlerFactoryAppServices"/>
      <remove name="ScriptResource"/>
      <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
      <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
      <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
      <add name="CrystalImageHandler.aspx_GET" verb="GET" path="CrystalImageHandler.aspx" type="CrystalDecisions.Web.CrystalImageHandler, CrystalDecisions.Web, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" preCondition="integratedMode"/>
    </handlers>
  </system.webServer>
  <runtime>
    <assemblyBinding appliesTo="v2.0.50727" xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35"/>
        <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35"/>
        <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
</configuration>

我不知道出了什么问题,因为我是 asp.net 的新手,部署到 iis-things

注意:

  • 我确实在我的路径文件夹上授予了 IIS_IUSR 和网络服务的完全权限。
  • 一些信息说,管理工具-> IIS 管理器-> 您的服务器名称-> 您的站点名称-> 在 HTTP 功能下-> 默认文档-> 添加 MyDefaultPage.aspx。但我不需要任何默认页面,因为我的站点仅在其他站点调用其页面并在 url 中给出特定响应时才起作用。所以我离开我的网站时没有默认页面

【问题讨论】:

  • 您在应用程序中尝试访问的请求 url 是什么?
  • 您是否在 web.config 文件中启用了身份验证窗口?
  • @mdowes www.mysitename.com 就是这样
  • 不,我没有,但有必要吗? @Ratheesh
  • 如果您使用的是 Windows 身份验证,则它是必要的。请查看此链接以了解您的问题和不明白的weblogs.asp.net/gurusarkar/…

标签: asp.net .net iis


【解决方案1】:

找到了解决方案。 通过在站点-> 您的站点-> IIS 部分中设置默认文档。选择默认文档子菜单并添加您的默认页面(以防万一)。也可以通过设置 IIS_IUS 和 NETWORK SERVICE 的完全权限

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-06-12
    • 1970-01-01
    • 2011-02-17
    • 2021-08-31
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多