其他分享
首页 > 其他分享> > .Net 5 AutoFac 配置

.Net 5 AutoFac 配置

作者:互联网

AutoFac 配置:

1.引入NueGet包:Autofac.Extensions.DependencyInjection

 

 2.在Program里面,引入:using Autofac.Extensions.DependencyInjection;

 

 3.在Startup里面,引入:using Autofac,在ConfigureServices 下面 加入

 

 

参考链接:https://autofac.readthedocs.io/en/latest/integration/aspnetcore.html#asp-net-core-3-0-and-generic-hosting

 

标签:AutoFac,配置,Autofac,Extensions,using,引入,DependencyInjection,Net
来源: https://www.cnblogs.com/lhy7/p/16339612.html