ASP.NET MVC页面报错System.InvalidOperationException The view found at #39;~ViewsHomeIndex.cshtml#39; was not created.

Application Exception

System.InvalidOperationException

The view found at ‘~/Views/Home/Index.cshtml‘ was not created.

Description: HTTP 500.Error processing request.

Details: Non-web exception. Exception origin (name of application or object): System.Web.Mvc.
Exception stack trace:

at System.Web.Mvc.BuildManagerCompiledView.Render (System.Web.Mvc.ViewContext viewContext, System.IO.TextWriter writer) [0x00061] 
in
cc73190bab9d435c831510ff295c572a:0 at System.Web.Mvc.ViewResultBase.ExecuteResult (System.Web.Mvc.ControllerContext context) [0x00080] in cc73190bab9d435c831510ff295c572a:0 at System.Web.Mvc.ControllerActionInvoker.InvokeActionResult (System.Web.Mvc.ControllerContext controllerContext, System.Web.Mvc.ActionResult actionResult) [0x00000]
in cc73190bab9d435c831510ff295c572a:0 at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive (System.Collections.Generic.IList`1[T] filters, System.Int32 filterIndex, System.Web.Mvc.ResultExecutingContext preContext, System.Web.Mvc.ControllerContext controllerContext, System.Web.Mvc.ActionResult actionResult) [0x0000b]
in cc73190bab9d435c831510ff295c572a:0 at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive (System.Collections.Generic.IList`1[T] filters, System.Int32 filterIndex, System.Web.Mvc.ResultExecutingContext preContext, System.Web.Mvc.ControllerContext controllerContext, System.Web.Mvc.ActionResult actionResult) [0x0009b]
in cc73190bab9d435c831510ff295c572a:0 at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters (System.Web.Mvc.ControllerContext controllerContext, System.Collections.Generic.IList`1[T] filters, System.Web.Mvc.ActionResult actionResult) [0x0000a]
in cc73190bab9d435c831510ff295c572a:0 at System.Web.Mvc.Async.AsyncControllerActionInvoker+c__DisplayClass21+c__DisplayClass2b.BeginInvokeActionb__1c () [0x0008a] in cc73190bab9d435c831510ff295c572a:0

解决办法:这可能是因为Web服务器部署环境中缺少了类库System.Web.WebPages.Deployment.dll

当然,造成这个错误的原因很多,这只是一种解决办法,供参考。

ASP.NET MVC页面报错System.InvalidOperationException The view found at '~/Views/Home/Index.cshtml' was not created.

原文地址:http://www.cnblogs.com/andy65007/p/7258756.html


最新回复(0)
/jishuK567QKwSw0EKy3rj6t1rWc_2BC8ZxVdphzut_2Ffd7OClnc_3D4719369
8 简首页