asp.net - 天青错误。您没有权限查看该目录或页面

标签 asp.net azure

当我导航到部署的 Azure 网站时,出现错误,

You do not have permission to view this directory or page.

在我的 web.config 中

 <system.web>
    <compilation debug="true" targetFramework="4.7"/>
    <httpRuntime targetFramework="4.7"/>
  </system.web>
  <system.webServer>
    <handlers>
      <remove name="ExtensionlessUrlHandler-Integrated-4.0"/>
      <remove name="OPTIONSVerbHandler"/>
      <remove name="TRACEVerbHandler"/>
      <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler"
        preCondition="integratedMode,runtimeVersionv4.0"/>
    </handlers>
  </system.webServer> 

完整源代码为in my github 。我跟着 microsoft documentation将我的应用程序部署到azure。当我在本地运行我的应用程序时,没有错误。

最佳答案

You do not have permission to view this directory or page.

根本原因是您的 Azure 网站中没有默认页面。

您可以直接查看以下网址的页面,应该可以。

https://{siteanme}.azurewebsites.net/views/login.html

或者您可以添加default document在项目根文件夹中,将其设置为 Azure 门户上的 appsetting 中的默认页面,然后保存设置。

The default document is the web page that is displayed at the root URL for a website.

enter image description here

关于asp.net - 天青错误。您没有权限查看该目录或页面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49018619/

相关文章:

asp.net-mvc - Azure Redis 缓存 VS 应用程序缓存

处理不同浏览器的JavaScript问题

asp.net - 使用 "dnu publish"排除发布项目上的文件夹

c# - 针对非异步服务的异步编程

azure - 如何将全局管理员角色分配给 Azure 中的服务主体?

C# Web 应用程序未通过 Azure 混合连接连接到本地 SQL Server

asp.net - MVC 3 中的 Windows 身份验证

asp.net - GridView 中 TemplateField 上的 header

Azure Redis 缓存服务丢失了所有数据

Azure Devops Powershell 任务 : Programmatic Access of Build Variables