.net core 3.1 右键 添加 找不到 “区域(Area)”,遇到这个问题,真是很无语,后来这顿研究,终于找到了解决方案。

首先你要自己添加一个Areas文件夹,,然后在这个文件夹(Areas)上“右键”->“添加”就看到有“区域”啦!

然后需要添加路由器,在Startup.cs文件中 app.UseEndpoints 里面添加:

1  endpoints.MapControllerRoute(
2        name: "areas",
3        pattern: "{area:exists}/{controller=Login}/{action=Index}/{id?}");

 

相关文章:

  • 2021-06-12
  • 2021-09-24
  • 2022-01-17
  • 2021-08-15
  • 2022-12-23
  • 2022-12-23
  • 2021-09-06
  • 2022-01-20
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-03-01
  • 2022-01-13
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案