none
RedisSessionStateProvider package in .Net core 1.0? RRS feed

  • Question

  • Hi team,

    I have .Net core 1.0 project .I am trying to add RedisSessionStateProvider NuGet package but looks like its doesnt support .net core 1.0  whereas i used to have same package in Rc2 .net 4.6.2 ...

    Is it true redisssessionStateprovide doesnt support core 1.0 ?if so whats work around to achieve same in core?

    Thanks,

    Roshan

    Sunday, November 27, 2016 3:05 PM

All replies

  • Hi Roshan,

    >>Is it true redisssessionStateprovide doesnt support core 1.0 ?if so whats work around to achieve same in core?

    Yes, It is not support. That's for Asp.Net 4.0, not Asp.Net Core. I think you're looking for Microsoft.Extensions.Caching.Redis, but you'll need 1.1.0 from the nightly feed for .Net Core support.

    You can get 1.1.0 from https://github.com/aspnet/Home/wiki/NuGet-feeds, and you need the aspnetcore-dev feed.

    Best regards,

    Kristin


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    • Edited by Kristin Xie Monday, November 28, 2016 3:16 AM
    Monday, November 28, 2016 3:16 AM
  • Thanks Kristin.. i do have Microsoft.Extensions.Caching.Redis 1.1.0  in core1.0 which works fine. I believe this is required to store key value redis cache.. But i wanted redissessionstateprovider to store redis session values..Any suggestion to store redis session (not redis cache) using core?

    Below two packaged i used in .net 4.6.2 rc2 but not able to use redissessionstateprovider in core.

    "Microsoft.Extensions.Caching.Redis": "1.0.0",
     "Microsoft.Web.RedisSessionStateProvider": "2.2.2",


    Monday, November 28, 2016 3:49 AM
  • But i wanted redissessionstateprovider to store redis session values..Any suggestion to store redis session (not redis cache) using core?

    Below two packaged i used in .net 4.6.2 rc2 but not able to use redissessionstateprovider in core.

    "Microsoft.Extensions.Caching.Redis": "1.0.0",
     "Microsoft.Web.RedisSessionStateProvider": "2.2.2",


    @Roshan,

    I've searched all Core API at https://docs.microsoft.com/en-us/aspnet/core/api/

    Unfortunately, I don't find any class related to store redis session. Currently, I am afraid there is no class using in Core.

    >>Below two packaged i used in .net 4.6.2 rc2 but not able to use redissessionstateprovider in core.

    "Microsoft.Extensions.Caching.Redis": "1.0.0",
     "Microsoft.Web.RedisSessionStateProvider": "2.2.2",

    Here I test .Net 4.6.2, it works fine.

    How to call?

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Threading.Tasks;
    #if NET462
    using Microsoft.Extensions.Caching.Redis;
    using Microsoft.Web.RedisSessionStateProvider;
    
    #endif
    namespace ClassLibrary1
    {
        public class Class1
        {
            public Class1()
            {
    #if NET462
      Microsoft.Extensions.Caching.Redis.RedisCache a=new RedisCache();;
      Microsoft.Web.Redis.RedisSessionStateProvider b=new RedisSessionStateProvider ();
                b.CreateNewStoreData();
    #endif
            }
         }
    }

    Best regards,

    Kristin


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.






    • Edited by Kristin Xie Monday, November 28, 2016 8:03 AM
    Monday, November 28, 2016 7:10 AM
  • Thanks Kristin..I will also try the same way..could you pls show me your project.json..i too added net462 in framework but all dependencies got installed for net462 as well..Cant i add only redis related nuget packages from 4.6.2 and rest from core?

      "frameworks": {
        "netcoreapp1.0": {
          "imports": [
            "dotnet5.6",
            "portable-net45+win8"
          ]
        },
        "net462": {}
      },

     
    Monday, November 28, 2016 8:01 PM
  • Hi Roshan,

    Here is my Project .Json

    "frameworks": {
        "netstandard1.6": {
          "dependencies": {
            "NETStandard.Library": "1.6.0",
            "Microsoft.Extensions.Caching.Redis.Core": "1.0.3"
          }       
        },
    
        "net462": {
          "dependencies": {        
            "Microsoft.Web.RedisSessionStateProvider": "2.2.2"
          }       
        }
      } 


    Best regards,

    Kristin


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Proposed as answer by Kristin Xie Thursday, December 1, 2016 5:45 AM
    Tuesday, November 29, 2016 3:33 AM
  • Cool!! I too did same way but now i am getting compile error for most of them references.. Lets say if i am using JsonResult then it says  webProject.Net Framework 4.6.2 - Not available , webProject.NetFramework .NetCoreApp, version=v1.0 - Available.. I get think kind of error almost for all other objects.. looks like its not looking for only in .NetCoreApp version =v1.0 since we have added two framework its always checking in both... is there any way that we can make references pointed to only core framework...i wanted to share screen shot with you but its not allowing to attach screenshot..
    Tuesday, November 29, 2016 2:51 PM
  • Hi Roshan,

    >>I too did same way but now i am getting compile error for most of them references..

    Yes, I also did my Visual Studio no response. My suggestion is try to recreate a new project and do not always compile. It looks high memory consumption of ASP.NET Core.

    >>is there any way that we can make references pointed to only core framework...

    If you have to use RedisSessionStateProvider, I am afraid there is no way. But I suggest you use Microsoft.Extensions.Caching.Redis instead.

    >>i wanted to share screen shot with you but its not allowing to attach screenshot..

    This is a forum issue. You need to verify Your Account.

    Best regards,

    Kristin


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, November 30, 2016 1:31 AM