MVC 5查看引擎

时间:2016-03-08 12:52:22

标签: asp.net-mvc-5 viewengine

我最近开始学习MVC5(使用Visual Studio 2015社区),所以我对视图引擎有疑问。

有人可以高兴解释一下MVC5视图引擎吗?我有点困惑,因为如果我重命名我的Index.cshtml视图文件,我会收到一条错误消息,表明正在搜索ASPX视图,而当我创建一个视图时,我没有&#39 ; t可以选择一个视图引擎(必须坚持使用Razor)。

即使我安装了其他模板(例如 - Spark),当我尝试创建新视图时,我仍然没有提供它们。从我看到的,在MVC4中有一个选项可以从下拉列表中进行选择。

我已经阅读了一篇关于堆栈溢出的文章:Using ASPX View Engine with MVC 5,但是我已经了解为什么它首先搜索ASPX,如果我甚至不能选择它。欢迎任何有关此事的详细说明。

The view 'Index' or its master was not found or no view engine supports the searched locations. The following locations were searched:
~/Views/ControllerName/Index.aspx
~/Views/ControllerName/Index.ascx
~/Views/Shared/Index.aspx
~/Views/Shared/Index.ascx
~/Views/ControllerName/Index.cshtml
~/Views/ControllerName/Index.vbhtml
~/Views/Shared/Index.cshtml
~/Views/Shared/Index.vbhtml
ControllerName\Index.spark
Shared\Index.spark
ControllerName\Index.shade
Shared\Index.shade

0 个答案:

没有答案