package.json
"Microsoft.AspNetCore.Session":"1.0.0-rc2-*",
"Microsoft.Extensions.Caching.Memory":"1.0.0-rc2-*"
Startup.cs
public void ConfigureServices(IServiceCollection services)
{
services.AddSession();
services.AddCaching();
}
public void Configure(IApplicationProvider app)
{
app.AddSession();
}
I am unable to resolve dependency for method AddCaching() and getting error: 'IServiceCollection' does not contain a definition for 'AddCaching' and no extension method 'AddCaching' accepting a first argument of type 'IServiceCollection' could be found.
Even I comment this method call and compile code, receive another error: Unable to resolve service for type 'Microsoft.AspNetCore.Session.ISessionStore' while attempting to activate 'Microsoft.AspNetCore.Session.SessionMiddleware'
Basically, RC2 documentation is not in place (#1508).
@avikenjale the method got renamed to AddMemoryCache.
@javiercn could you create an announcement for https://github.com/aspnet/Caching/commit/a6c044c1590b16c98df1cc6d01eca1140a86ee99 if there isn't one already?
@pranavkm, That is fine, however I am still getting the error of service. Any idea how it can be resolved? Am I still missing anything?
I believe you also need to do AddDistributedMemoryCache()
This issue is being closed because it has not been updated in 3 months.
We apologize if this causes any inconvenience. We ask that if you are still encountering this issue, please log a new issue with updated information and we will investigate.
Most helpful comment
@avikenjale the method got renamed to
AddMemoryCache.@javiercn could you create an announcement for https://github.com/aspnet/Caching/commit/a6c044c1590b16c98df1cc6d01eca1140a86ee99 if there isn't one already?