Skip to content

Commit aa551b1

Browse files
committed
Improved exception message.
1 parent 61200f3 commit aa551b1

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/SimpleInjector.Integration.AspNetCore.Mvc/SimpleInjectorAspNetCoreBuilderMvcExtensions.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ private static ApplicationPartManager GetApplicationPartManager(
134134
"system. This is most likely caused by a missing call to services.AddMvcCore() or " +
135135
"services.AddMvc() as part of the ConfigureServices(IServiceCollection) method of " +
136136
"the Startup class. A call to one of those methods will ensure the registration " +
137-
"of the {1}.",
137+
"of the {1}. Make sure you make this call -before- calling services.AddSimpleInjector().",
138138
typeof(ApplicationPartManager).FullName,
139139
typeof(ApplicationPartManager).Name));
140140
}
@@ -148,8 +148,7 @@ private static ApplicationPartManager GetApplicationPartManager(
148148
"for Simple Injector's {1} method to get this instance from ASP.NET Core's " +
149149
"IServiceCollection. This is most likely because {2} was overridden by you or a " +
150150
"third-party library. Make sure that you use the AddSingleton overload that takes " +
151-
"in an existing instance—i.e. call " +
152-
"services.AddSingleton<{2}>(new {2}()).",
151+
"in an existing instance—i.e. call services.AddSingleton<{2}>(new {2}()).",
153152
typeof(ApplicationPartManager).FullName,
154153
methodName,
155154
typeof(ApplicationPartManager).Name));

0 commit comments

Comments
 (0)