Skip to main content
1 of 2
Aman B
  • 2.4k
  • 1
  • 20
  • 28

If you want to use ICommonLogService in the startup class, you need to get an instance from the container like this:

public IServiceProvider ConfigureServices(IServiceCollection services) { var container = new Container(); container.Configure(config => { config.AddRegistry(new StructuremapRegistry()); config.Populate(services); }); //Get an instance of ICommonLogService from container ICommonLogService CommonLogService = container.GetInstance<ICommonLogService>(); //Use CommonLogService here return container.GetInstance<IServiceProvider>(); } 
Aman B
  • 2.4k
  • 1
  • 20
  • 28