While deploying in IIS getting error : The view 'Index' or its master was not found or no view engine supports the searched locations

While deploying in IIS getting error : The view 'Index' or its master was not found or no view engine supports the searched locations

我在服务器或本地 IIS 上部署代码后出现此错误,但在调试模式下一切正常。消息很清楚,它无法找到 index.cshtml 文件,但一切都在它的位置。

应用程序错误:

项目文件:

装配信息:

您应该检查 ~/Views/Home/Index.cshtml 是否在您部署的应用程序中可用并且是否在正确的目录中,而不是您所说的在调试模式下工作的开发位置。