InvalidOperationException: The view 'Register' was not found. The following locations were searched:
/Views/Account/Register.cshtml
/Views/Shared/Register.cshtml
出现此错误。
在我的帐户管理员中,我有:
public class AccountController : Controller
{
[HttpGet]
public IActionResult Register()
{
return View();
}
[HttpGet]
public IActionResult Login()
{
return View();
}
}
该视图显然存在:
我已经尝试在Account(应该在其中。)中,只是在共享中尝试了这两种方法,如下所示。每次相同的错误。 Login
可以正常工作。我尝试了一个干净的版本,并得到相同的问题。
在您创建的项目上设置routes.MapRoute