我想开发一个 .net 应用程序,其中包含一个简单的 index.cshtml。 Azure WebApp 支持 CI,因此我已将 index.cshtml 放入 github 项目中。没有 .sln,没有 visual studio 文件——纯文本文件(就好像我在控制台 linux 上只有 nano 和 git)。我将 WebApp 中的默认文档更改为 index.cshtml,提供了包含网站内容的目录路径。
但我确实看到了 您没有查看此目录或页面的权限。 /页面和
Description: The type of page you have requested is not served because it has been explicitly forbidden. The extension '.cshtml' may be incorrect. Please review the URL below and make sure that it is spelled correctly.
Requested URL: /index.cshtml
如果我尝试去索引directly .
那么除了我的 index.cshtml 文件之外还需要什么 my WebApp上类?
请您参考如下方法:
您只需添加以下 web.config文件:
<configuration>
<appSettings>
<add key="webPages:Version" value="1.0"/>
</appSettings>
<system.web>
<customErrors mode="Off"/>
<compilation debug="true" targetFramework="4.0" />
</system.web>
</configuration>
从技术上讲,<system.web>部分是可选的,但会帮助您调试问题。
