当我导航到部署的 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.
关于asp.net - 天青错误。您没有权限查看该目录或页面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49018619/