ASP.NET Core MVC配置差异(3.0和2.X)
程序员文章站
2022-05-03 12:49:20
https://www.cnblogs.com/lonelyxmas/p/10934388.html net core 2.x MVC配置 public void ConfigureServices(IServiceCollection services) { services.addMvc(); ......
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?}"); }); }
下一篇: 揭秘:为何明朝前期的功臣大多都死于非命?
推荐阅读
-
在Asp.Net Core中配置使用MarkDown富文本编辑器实现图片上传和截图上传(开源代码.net core3.0)
-
Asp.Net Core中配置使用Kindeditor富文本编辑器实现图片上传和截图上传及文件管理和上传(开源代码.net core3.0)
-
ASP.NET Core MVC配置差异(3.0和2.X)
-
在Asp.Net Core中配置使用MarkDown富文本编辑器实现图片上传和截图上传(开源代码.net core3.0)
-
ASP.NET Core MVC配置差异(3.0和2.X)
-
asp.net core 3.0 MVC JSON 全局配置
-
Asp.Net Core中配置使用Kindeditor富文本编辑器实现图片上传和截图上传及文件管理和上传(开源代码.net core3.0)