Open alexpantyukhin opened 1 month ago
ASP.NET Core does not register ISession
in the IServiceCollection
and it can, therefore, not be pulled in by Simple Injector. In other words, your SessionVars
could not have been resolved by MS.DI if you registered it in the services
collection.
For more information, see this answer.
Thank you very much!
Hello, I the following part of the Program startup for the asp.net core mvc app:
Also I have the controller:
And I have a problem when container.Verify(); :
The configuration is invalid. Creating the instance for type SessionVars failed. The constructor of type SessionVars contains the parameter with name 'session' and type ISession, but ISession is not registered. For ISession to be resolved, it must be registered in the container.
TheISession
is from namespace:Microsoft.AspNetCore.Http
.Package information: "Microsoft.AspNet.Mvc" Version="5.2.7" "SimpleInjector" Version="5.4.2" "SimpleInjector.Integration.AspNetCore.Mvc" Version="5.5.0"