网站迁移 出现Server Error in '/' Application.一直找不到毛病求助!

qq_26996761 2018-03-01 10:03:19
Server Error in '/' Application.

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

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: 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

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[InvalidOperationException: 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]
System.Web.Mvc.ViewResult.FindView(ControllerContext context) +439
System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) +147
System.Web.Mvc.<>c__DisplayClass1c.<InvokeActionResultWithFilters>b__19() +33
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +613
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) +263
System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +720
System.Web.Mvc.Controller.ExecuteCore() +162
System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +305
System.Web.Mvc.<>c__DisplayClassb.<BeginProcessRequest>b__5() +62
System.Web.Mvc.Async.<>c__DisplayClass1.<MakeVoidDelegate>b__0() +15
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +606
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +288

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.34209
...全文
549 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
正怒月神 版主 2018-03-01
  • 打赏
  • 举报
回复
引用 4 楼 qq_26996761 的回复:
呃,由于是帮人帮网站转移到我们单位服务器上。以前也没接触过.NET,所以不谁很懂这块,安装习惯,搭建环境,拷贝文件,还原数据库。然后就这样悲剧了。他们的这个网站不是新建的,运行了很久的网站了。具体删没删出home,我不清楚,但是现在运行正常的网站确实谁Views目录下确实没有HOME这个目录。不懂麻烦大神多解释下。
你看看 项目中 文件夹 App_Start下 RouteConfig文件里 routes.MapRoute( name: "Default", url: "{controller}/{action}/{id}", defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional } ); 这个配置,里面设置的是什么 修改一下 controller
qq_26996761 2018-03-01
  • 打赏
  • 举报
回复
引用 3 楼 hanjun0612 的回复:
Home在创建项目是,如果不是创建空网站,就会默认带上Home的 controller和 view。 然后你把他们删了? 那么你的路由改过了吗?因为路由默认是 home/index
呃,由于是帮人帮网站转移到我们单位服务器上。以前也没接触过.NET,所以不谁很懂这块,安装习惯,搭建环境,拷贝文件,还原数据库。然后就这样悲剧了。他们的这个网站不是新建的,运行了很久的网站了。具体删没删出home,我不清楚,但是现在运行正常的网站确实谁Views目录下确实没有HOME这个目录。不懂麻烦大神多解释下。
qq_26996761 2018-03-01
  • 打赏
  • 举报
回复
引用 1 楼 duanzi_peng 的回复:
文件丢失? 你把 The view 'index' or its master was not found or no view engine supports the searched locations 这句话 贴到百度或者其它的搜索框中,要能根据异常定位到反馈的主要信息提示。
没丢失,文件打包过来的。所以不明所以。根本没有HOME文件夹,百度了一下,都没说明白为什么出这个问题。所以来这求助了。
正怒月神 版主 2018-03-01
  • 打赏
  • 举报
回复
Home在创建项目是,如果不是创建空网站,就会默认带上Home的 controller和 view。 然后你把他们删了? 那么你的路由改过了吗?因为路由默认是 home/index
exception92 2018-03-01
  • 打赏
  • 举报
回复
文件丢失? 你把 The view 'index' or its master was not found or no view engine supports the searched locations 这句话 贴到百度或者其它的搜索框中,要能根据异常定位到反馈的主要信息提示。
qq_26996761 2018-03-01
  • 打赏
  • 举报
回复
引用 5 楼 hanjun0612 的回复:
[quote=引用 4 楼 qq_26996761 的回复:] 呃,由于是帮人帮网站转移到我们单位服务器上。以前也没接触过.NET,所以不谁很懂这块,安装习惯,搭建环境,拷贝文件,还原数据库。然后就这样悲剧了。他们的这个网站不是新建的,运行了很久的网站了。具体删没删出home,我不清楚,但是现在运行正常的网站确实谁Views目录下确实没有HOME这个目录。不懂麻烦大神多解释下。
你看看 项目中 文件夹 App_Start下 RouteConfig文件里 routes.MapRoute( name: "Default", url: "{controller}/{action}/{id}", defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional } ); 这个配置,里面设置的是什么 修改一下 controller [/quote] 谢谢,直接带上index.htm访问正常,但是如果不带文件后缀就不正常。。。。这个问题好奇怪!默认文档上都有。但是不能直接访问。只能带后缀访问。 网址http://a.jiningauto.com/。有懂的大神帮忙看看怎么回事。、

62,046

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧