Skip to content

Commit 9f6a71a

Browse files
committed
AddSimpleInjector now registers IServiceScope before calling setupAction. Fixes #17
1 parent aa551b1 commit 9f6a71a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/SimpleInjector.Integration.ServiceCollection/SimpleInjectorServiceCollectionExtensions.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,12 @@ public static IServiceCollection AddSimpleInjector(
7575

7676
HookAspNetCoreHostHostedServiceServiceProviderInitialization(options);
7777

78-
setupAction?.Invoke(options);
79-
78+
// We must register the service scope before calling the setupAction. This allows setup code to replace
79+
// it. See: #17.
8080
RegisterServiceScope(options);
8181

82+
setupAction?.Invoke(options);
83+
8284
if (options.AutoCrossWireFrameworkComponents)
8385
{
8486
AddAutoCrossWiring(options);

0 commit comments

Comments
 (0)