更新时间:2023-02-23 18:41:54
我相信您不是在使用MVC功能,而是尝试仅在外部视图或自定义Area文件夹中加载剃刀视图.
I believe you are not making using the MVC feature and trying to load just the razor view outside views or custom Area folders.
然后,您需要在.net 4.0中默认禁用的Web.config中启用网页密钥
Then you need to enable webpages key in Web.config which is disabled by default in .Net 4.0
<add key="webpages:Enabled" value="true" />