https://www.cnblogs.com/lonelyxmas/p/10934388.html

net core 2.x MVC配置

        public void ConfigureServices(IServiceCollection services)
{
services.addMvc();
}
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env,IConfiguration configurarion,IWelcome welcome)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
} app.UseRouting();
app.UseStaticFiles(); app.UseMvc(routs =>
{
routs.MapRoute("default", "{controller=Home}/{action=Index}/{id?}");
});
}

net core 3.x MVC配置

        public void ConfigureServices(IServiceCollection services)
{
services.AddControllersWithViews();
}
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env,IConfiguration configurarion,IWelcome welcome)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
} app.UseRouting();
app.UseStaticFiles(); app.UseEndpoints(endpoints =>
{
endpoints.MapControllerRoute("default", "{controller=Home}/{action=Index}/{id?}");
});
}

最新文章

  1. 使用nodejs+express(4.x+)实现文件上传
  2. 161209、简要分析ZooKeeper基本原理及安装部署
  3. MySQL表分区
  4. FZU 2148 moon game (计算几何判断凸包)
  5. Python学习 之 函数
  6. CentOS系统安全配置
  7. poj2390
  8. 【从翻译mos文章】oracle linux 和外部存储系统 关系
  9. C# CodeFirst编程模型一
  10. [算法题] Reverse Linked List
  11. Luogu P1541 乌龟棋(NOIP2010TG)
  12. python六十六课——单元测试(二)
  13. springboot入门使用
  14. mysql事务及慢查询
  15. HTML基础学习笔记(1)
  16. POJ3258--River Hopscotch(Binary Search similar to POJ2456)
  17. 【转】C# 根据当前时间获取,本周,本月,本季度等时间段 .Net中Exception
  18. 35-面试:如何找出字符串的字典序全排列的第N种
  19. ArcGIS10+:ArcGIS version not specified. You must call RuntimeManager.Bind before creating any ArcGIS
  20. 牛客国庆集训派对Day6 Solution

热门文章

  1. 《Java练习题》Java编程题合集(全)
  2. AudioFormat.Encoding
  3. IT兄弟连 HTML5教程 CSS3属性特效 自定义文字
  4. 【译】浅谈SOLID原则
  5. mysql存储4字节的表情包数据报异常_Emoji表情包_Incorrect string value: '\xF0\x9F\x98\x84\xF0\x9F
  6. mysql5.5下载安装教程
  7. 番茄助手 最新 Visual Assist X 适应于VS2019 VS2017 VS2015 VS2013 亲测可用
  8. Python装饰器(Decorators )
  9. MySQL数据库~~~~~存储引擎
  10. SSM案例整合踩的一些坑