asp.net - 存在时找不到索引视图
问题描述
我有一个托管在 Service Fabric 本地群集中的 AspNetCore.Mvc 站点。大多数情况下它运行良好,但有时它找不到索引视图。这是索引视图根本没有改变。在对集群进行一些重置或尝试使用 git clean 和其他一些东西之后,它又开始工作了。我试图弄清楚是什么原因造成的。
InvalidOperationException: The view 'Index' was not found. The following locations were searched:
/Views/Home/Index.cshtml
/Views/Shared/Index.cshtml
/Pages/Shared/Index.cshtml
Microsoft.AspNetCore.Mvc.ViewEngines.ViewEngineResult.EnsureSuccessful(IEnumerable<string> originalLocations)
Microsoft.AspNetCore.Mvc.ViewFeatures.ViewResultExecutor.ExecuteAsync(ActionContext context, ViewResult result)
Microsoft.AspNetCore.Mvc.ViewResult.ExecuteResultAsync(ActionContext context)
Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeResultAsync(IActionResult result)
Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeNextResultFilterAsync<TFilter, TFilterAsync>()
Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Rethrow(ResultExecutedContext context)
Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.ResultNext<TFilter, TFilterAsync>(ref State next, ref Scope scope, ref object state, ref bool isCompleted)
Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeResultFilters()
Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeNextResourceFilter()
Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Rethrow(ResourceExecutedContext context)
Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Next(ref State next, ref Scope scope, ref object state, ref bool isCompleted)
Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeFilterPipelineAsync()
Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeAsync()
Microsoft.AspNetCore.Builder.RouterMiddleware.Invoke(HttpContext httpContext)
Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.Invoke(HttpContext context)
Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)
解决方案
推荐阅读
- sd-card - 如何读取/写入字节到 MC60A 的 SD 卡插槽?
- javascript - 如何将数组映射到日期?
- css - 元素的条件样式
- postgresql - Go Lang, Postgres: cannot get oid after Scan
- python - PyMongo:无法列出数据库集合
- .net - 将照片调整为与 Active Directory 兼容的格式
- reactjs - 位置数组的反应传单中心
- android - 在 Android 中备份 SQLite 数据库
- zend-framework - 在 Zend 1.11 的 Bootstrap.php 文件中获取模块、控制器和动作名称
- wordpress - 添加菜单作为最后一项 - Wordpress