创建了自定义int主键打开页面生成报错

发布于 2021-01-11 23:26:52

System.InvalidOperationException: The view 'Index' was not found. The following locations were searched:
/Views/_CodeGen/Index.zh.cshtml
/Views/_CodeGen/Index.cshtml
/Views/Shared/Index.zh.cshtml
/Views/Shared/Index.cshtml
/Pages/Shared/Index.zh.cshtml
/Pages/Shared/Index.cshtml
at Microsoft.AspNetCore.Mvc.ViewEngines.ViewEngineResult.EnsureSuccessful(IEnumerable`1 originalLocations)
at Microsoft.AspNetCore.Mvc.ViewFeatures.ViewResultExecutor.ExecuteAsync(ActionContext context, ViewResult result)
at Microsoft.AspNetCore.Mvc.ViewResult.ExecuteResultAsync(ActionContext context)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResultFilterAsync>g__Awaited|29_0TFilter,TFilterAsync

查看更多

关注者
0
被浏览
301
1 个回答
weiguozhi
weiguozhi 2021-01-11

已经找到原因了,之前没有自定义主键,生成了部分代码,删掉之前删除的就ok了

撰写答案

请登录后再发布答案,点击登录

发布
问题

分享
好友

手机
浏览

扫码手机浏览