I've encountered this when switching from SM to Lamar and got Issues with the Nancy bootstrapper. Nancy needs to register internal types which results in multiple .Configure() calls.
The WhatDoIHave():
Non-Working vase
=========================================================================================================================================
ServiceType Namespace Lifecycle Description Name
-----------------------------------------------------------------------------------------------------------------------------------------
BaseThing StructureMap.Testing.Acceptance Transient new Thing1() thing1
-----------------------------------------------------------------------------------------------------------------------------------------
IContainer Lamar Scoped Current IContainer IContainer
-----------------------------------------------------------------------------------------------------------------------------------------
IServiceContext Lamar Scoped Current IServiceContext IServiceContext
-----------------------------------------------------------------------------------------------------------------------------------------
IServiceProvider System Scoped Current IServiceProvider IServiceProvider
-----------------------------------------------------------------------------------------------------------------------------------------
IServiceScopeFactory Microsoft.Extensions.DependencyInjection Singleton Current IServiceScopeFactory IServiceScopeFactory
-----------------------------------------------------------------------------------------------------------------------------------------
IWidget StructureMap.Testing.Widget Transient new AWidget() aWidget
-----------------------------------------------------------------------------------------------------------------------------------------
Scope Lamar.IoC Scoped Current Scope Scope
=========================================================================================================================================
Working vase
=========================================================================================================================================
ServiceType Namespace Lifecycle Description Name
-----------------------------------------------------------------------------------------------------------------------------------------
BaseThing StructureMap.Testing.Acceptance Transient new Thing1(widget) thing1
-----------------------------------------------------------------------------------------------------------------------------------------
IContainer Lamar Scoped Current IContainer IContainer
-----------------------------------------------------------------------------------------------------------------------------------------
IServiceContext Lamar Scoped Current IServiceContext IServiceContext
-----------------------------------------------------------------------------------------------------------------------------------------
IServiceProvider System Scoped Current IServiceProvider IServiceProvider
-----------------------------------------------------------------------------------------------------------------------------------------
IServiceScopeFactory Microsoft.Extensions.DependencyInjection Singleton Current IServiceScopeFactory IServiceScopeFactory
-----------------------------------------------------------------------------------------------------------------------------------------
IWidget StructureMap.Testing.Widget Transient new AWidget() aWidget
-----------------------------------------------------------------------------------------------------------------------------------------
Scope Lamar.IoC Scoped Current Scope Scope
=========================================================================================================================================
This works (IWidget first):
This doesn't (BaseThing first):
I've encountered this when switching from SM to Lamar and got Issues with the Nancy bootstrapper. Nancy needs to register internal types which results in multiple .Configure() calls.
The WhatDoIHave():
Non-Working vase
Working vase