-
Notifications
You must be signed in to change notification settings - Fork 307
ConfigureServices IServiceCollection exception message is confusing. #502
Comments
Is confusing as well. I'm all for changing it to be clearer though. /cc @Eilon |
I'll come up with something. |
@Eilon last chance 😄 |
|
Slight modification @JunTaoLuo 's text:
|
Unassigning from me. @muratg can find a new owner to implement this complex feature 😄 |
Thanks for listening and caring about things like this. I know it would have been very easy to swat it away and say "nah, you just weren't thinking". I think the message you settled on was great and better than my proposal. |
@JesperTreetop of course, and thanks for bringing it to our attention! |
The code calling
ConfigureServices
generates the following exception message:When I got this, I read this as "
ConfigureServices
can take various parameters, but just one of the typeIServiceCollection
, so you're trying to use two or moreIServiceCollection
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 haveIHostingEnvironment
injected to set up services differently based on environment; I solved that by having the constructor, which can take it, squirrel away theIHostingEnvironment
instance).How about:
..?
The text was updated successfully, but these errors were encountered: