Get server error: "The view 'Index'或者没有找到母版,或者没

本文关键字:或者 server error The view Get Index quot | 更新日期: 2023-09-27 18:17:23

我已经创建了我的网站,它在我的本地系统中工作得很好,但是当我将它下载到服务器时,我得到这个错误:

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

乍一看很容易。服务器说我没有指定的文件,但是有观点' '指数。CSHTML文件在我的托管文件夹!就像我之前说的,这在我们当地的系统中运作良好。我还有Home name的控制器

这是我的路由配置:
        routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
        routes.MapRoute(
            name: "Default",
            url: "{controller}/{action}/{id}",
            defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
        );

这是网站的链接

Get server error: "The view 'Index'或者没有找到母版,或者没

检查提供者serverdevelopment环境中的MVC版本。然后您需要升级或降级版本,因为在两个上相同。

我发现我的问题了:我发布网站到本地文件夹,有所有的文件。但是当我通过FTP将其复制到服务器时,没有我的视图文件。抱歉有额外的问题!