Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

SQL Server Session Database

$
0
0

I am trying to configure SQL Server Session State database and below is the code snippet from Startup.cs

services.AddSqlServerCache(options =>
            {
                options.ConnectionString = "Data Source=DESKTOP-FN54FR0;Initial Catalog=ASPState;Integrated Security=True;Pooling=False";
                options.SchemaName = "dbo";
                options.TableName = "Sessions";
            });
            services.AddSession(options =>
            {
                options.CookieName = ".CompanyDiary.Session";
            });

Now how to do I actually create the database? I tried aspnet_regsql.exe but I get an error about database schema. It looks like the table structure ASP.NET 5 wants is different than previous versions. Is there a different/new utility I need to use to create an empty session state database?

Any help would be much appreciated.


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>