[已解决]An unhandled exception occurred while processing the request.

An unhandled exception occurred while processing the request.

InvalidOperationException: The layout view '~/Areas/Admin/Views/Shared/_Layout' could not be located. The following locations were searched:
~/Areas/Admin/Views/Shared/_Layout

Microsoft.AspNetCore.Mvc.Razor.RazorView.GetLayoutPage(ViewContext context, string executingFilePath, string layoutPath)

解决方法:

将模板页

@{
Layout = "~/Areas/Admin/Views/Shared/_Layout";
}

改成:

@{
Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml";
}

转载于:https://www.cnblogs.com/mhq-martin/p/8798871.html

你可能感兴趣的:([已解决]An unhandled exception occurred while processing the request.)