Azure Web Service .NET应用程序:此类页面未提供

问题描述 投票:1回答:1

我有一个在Azure Web服务上运行的asp.net框架应用程序,一切正常,然后突然我开始收到此错误:

Server Error in '/' Application.
This type of page is not served.
Description: The type of page you have requested is not served because it has been explicitly forbidden.     Please review the URL below and make sure that it is spelled correctly.

Requested URL: /

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.7.3535.0

该网站是MVC C#.NET-错误消息说它的发生是“因为它已被明确禁止。” -所以我猜这是一个配置问题。我认为这与我的代码无关,因为该应用程序在本地运行良好。 -

有人知道我应该使用什么配置设置来解决此问题吗?

c# azure azure-web-sites azure-webapps
1个回答
0
投票

也许您正在尝试直接访问〜/ Views文件夹之外的Razor页面。

在ASP.NET MVC 4中,默认情况下处于禁用状态。为了启用它,您需要做的就是在web.config中调整以下设置:

<add key="webpages:Enabled" value="true" />

有关更多详细信息,您可以看到此post。如果您需要进一步的帮助,则需要提供有关此问题的更多详细信息。

© www.soinside.com 2019 - 2024. All rights reserved.