每天早上在IIS 6上托管的剃刀页面失败

时间:2013-05-08 13:10:53

标签: asp.net iis

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

我遇到的问题是每天早上IE都显示“找不到页面或网络错误”消息。我刷新页面,它卡住了,没有显示任何内容。我尝试从不同的PC,打开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.

有趣的是,在我收到服务器上的错误后一瞬间,我试图打开网址的2个页面“没有卡住”,并且在当天余下的时间内显示页面没有任何问题,无论我是一直打开页面(每3分钟自动刷新一次)还是打开新的IE。第二天早上,同样的故事。

1 个答案:

答案 0 :(得分:1)

您无法导航至/application/Dashboard.cshtml。如果Dashboard中有操作HomeController,则网址必须为Home/Dashboard/,并且假设操作返回视图而未指定名称,则默认返回值为具有相同视图的视图将其命名为动作。