Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/314.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 获取服务器错误:";视图';指数';或者找不到其主节点,或者没有视图引擎支持搜索的位置”;简单的解决方案&x27;行不通_C#_Asp.net Mvc_Deployment_Hosting - Fatal编程技术网

C# 获取服务器错误:";视图';指数';或者找不到其主节点,或者没有视图引擎支持搜索的位置”;简单的解决方案&x27;行不通

C# 获取服务器错误:";视图';指数';或者找不到其主节点,或者没有视图引擎支持搜索的位置”;简单的解决方案&x27;行不通,c#,asp.net-mvc,deployment,hosting,C#,Asp.net Mvc,Deployment,Hosting,我已经创建了我的站点,它在本地系统中运行良好,但当我将其下载到服务器时,出现以下错误: 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.a

我已经创建了我的站点,它在本地系统中运行良好,但当我将其下载到服务器时,出现以下错误:

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
乍看起来很容易。服务器告诉我,我没有指定的文件,但有 查看我的托管文件夹中的\Home\Index.cshtml文件!正如我之前所说,它在我的本地系统中运行良好。此外,我有一个控制器与家庭的名字

这是我的路线配置:

        routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

        routes.MapRoute(
            name: "Default",
            url: "{controller}/{action}/{id}",
            defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
        );

这就是。

您可以在提供者
服务器
开发环境中使用
MVC
版本进行检查。然后,您需要升级或降级两个版本的版本。我发现了问题: 我将网站发布到本地文件夹,并且有所有文件。但当我通过FTP将其复制到服务器时,并没有我的视图文件。
对不起,还有问题

我在项目和.NET4中使用Asp.NETMVC4,但我的宿主提供程序只允许指定Asp.Net版本(因此我也指定了4版本)。Asp.Net和Asp.Net MVC的版本是否匹配?
MVC
版本需要在服务器和开发之间匹配。是否检查文件是否已正确复制到开发服务器是的,您是对的。这很奇怪。我将网站发布到本地文件夹,并且有所有文件。但当我通过FTP将其复制到服务器时,并没有我的视图文件。非常感谢。