0

我的 Intranet 中有一个简单的页面,它使用 Razor/ASP 从表中获取单个记录并将其显示,加上一些图形,作为仪表板显示。意思是,除了第一次打开 IE 到内部 URL 时,没有用户干预。

我遇到的问题是每天早上 IE 都会显示“找不到页面或网络错误”消息。我刷新页面,它卡住了,没有显示任何内容。我在另一台电脑上尝试,打开 IE 到内部 URL,它也卡住了......

...直到我执行以下操作:

  • 登录到托管页面的服务器
  • 运行 inetmgr 访问网站等
  • 右键单击给我问题的页面并选择Browse

在那一刻,我收到一条错误消息:

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.  The extension '.cshtml' may be incorrect.   Please review the URL below and make sure that it is spelled correctly. 

Requested URL: /application/Dashboard.cshtml

--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1 

我也在 Windows 应用程序日志中得到了这个:

Event code: 3005 
Event message: An unhandled exception has occurred. 
Event time: 5/8/2013 8:05:11 AM 
Event time (UTC): 5/8/2013 12:05:11 PM 
Event ID: 5a7c440506344f5583776e1e1ceb0679 
Event sequence: 4 
Event occurrence: 1 
Event detail code: 0 

Application information: 
    Application domain: /LM/W3SVC/2103969953/Root-2-130124883110906632 
    Trust level: Full 
    Application Virtual Path: / 
    Application Path: C:\Inetpub\wwwroot\CCTelecomAdmin\ 
    Machine name: ICSREC1 

Process information: 
    Process ID: 23760 
    Process name: w3wp.exe 
    Account name: NT AUTHORITY\NETWORK SERVICE 

Exception information: 
    Exception type: HttpException 
    Exception message: Path '/application/Dashboard.cshtml' is forbidden.
   at System.Web.HttpForbiddenHandler.ProcessRequest(HttpContext context)
   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)



Request information: 
    Request URL: http://localhost:8888/application/Dashboard.cshtml 
    Request path: /application/Dashboard.cshtml 
    User host address: 127.0.0.1 
    User:  
    Is authenticated: False 
    Authentication Type:  
    Thread account name: NT AUTHORITY\NETWORK SERVICE 

Thread information: 
    Thread ID: 2599 
    Thread account name: NT AUTHORITY\NETWORK SERVICE 
    Is impersonating: False 
    Stack trace:    at System.Web.HttpForbiddenHandler.ProcessRequest(HttpContext context)
   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)


Custom event details: 

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

有趣的是,在我在服务器上收到该错误后的一瞬间,我试图打开 URL 的 2 个页面“未卡住”,并且在一天的剩余时间里显示该页面没有任何问题,无论是否我一直保持页面打开(每 3 分钟自动刷新一次),或者如果我打开新的 IE。第二天早上,又是同样的故事。

4

1 回答 1

1

您无法导航到/application/Dashboard.cshtml。如果你有一个动作DashboardHomeController那么 URL 需要是Home/Dashboard/,并且假设动作返回一个没有指定名称的视图,默认返回是一个与动作同名的视图。

于 2013-05-08T14:03:21.137 回答