非常秘书全文阅读,丝印加工,射雕之不灭传说
1 public void configure(iapplicationbuilder app, ihostingenvironment env, iloggerfactory loggerfactory) 2 { 3 loggerfactory.addconsole(); 4 5 //…… 6 }
运行输出警告:“consoleloggerextensions.addconsole(iloggerfactory)”已过时:“this method is obsolete and will be removed in a future version. the recommended alternative is addconsole(this iloggingbuilder builder).”
program.cs 配置如下
1 public class program 2 { 3 public static void main(string[] args) 4 { 5 createwebhostbuilder(args).build().run(); 6 } 7 8 public static iwebhostbuilder createwebhostbuilder(string[] args) => 9 webhost.createdefaultbuilder(args) 10 .usestartup<startup>() 11 .configurelogging((hostingcontext, logging) => 12 { 13 logging.addconfiguration(hostingcontext.configuration.getsection("logging")); 14 logging.addconsole(); 15 logging.adddebug(); 16 }); 17 }
或者 startup.cs configureservices方法中配置如下
1 public void configureservices(iservicecollection services) 2 { 3 services.addlogging(logging => 4 { 5 logging.addconsole(); 6 logging.adddebug(); 7 }); 8 9 //…… 10 }
如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复
Blazor server side 自家的一些开源的, 实用型项目的进度之 CEF客户端
.NET IoC模式依赖反转(DIP)、控制反转(Ioc)、依赖注入(DI)
vue+.netcore可支持业务代码扩展的开发框架 VOL.Vue 2.0版本发布
网友评论