Install-Package Abner.ModuleInitialize to your start up project and module project;
In your project create a class which should implemnet interface IModuleInitializer, then configure the service like where you configure in StartUp.ConfigureService();
In your start up project , add this line
// 加载当前运行目录所有程序集
services.AddModuleInitializer();or
// 只加载引用的程序集
services.AddRefrenceModuleInitializer();