Asp.Net.Core 报错:Session has not been configured for this application or request

 

解决方案:

Startup.cs 

方法-ConfigureServices  添加代码

     services.AddDistributedMemoryCache();
            services.AddSession();

方法-Configure  添加代码

            app.UseSession();

 

 

 

posted @ 2021-03-05 09:26  Lin_pin  阅读(270)  评论(0编辑  收藏  举报