ConfigureServices IServiceCollection exception message is confusing. #502
Description
The code calling ConfigureServices
generates the following exception message:
ConfigureServices can take at most a single IServiceCollection parameter.
When I got this, I read this as "ConfigureServices
can take various parameters, but just one of the type IServiceCollection
, so you're trying to use two or more IServiceCollection
parameters"! I had to go find the code where the exception was thrown to realize that it meant that it can't take any other parameters, which was my problem (trying to have IHostingEnvironment
injected to set up services differently based on environment; I solved that by having the constructor, which can take it, squirrel away the IHostingEnvironment
instance).
How about:
ConfigureServices can not take any parameters besides at most one IServiceCollection parameter.
..?