After installing .Net Framework on your system, open windows command prompt and navigate to framework installation directory as per your installed version of .net framework and system architecture.
c:> cd "%windir%Microsoft.NETFramework64v4.0.30319"
Directory path may be change as per your installation like below.
.NET Framework 2.0/3.0/3.5 (32-bit): %windir%Microsoft.NETFrameworkv2.0.50727 .NET Framework 2.0/3.0/3.5 (64-bit): %windir%Microsoft.NETFramework64v2.0.50727 .NET Framework version 4 (32-bit): %windir%Microsoft.NETFrameworkv4.0.30319 .NET Framework version 4 (64-bit): %windir%Microsoft.NETFramework64v4.0.30319
Now execute following command to finally create database named ASPState in SQL server defined instance. As per below command DB1SQLEXPRESS is my sql instance.
aspnet_regsql.exe -ssadd -sstype p -S DB1SQLEXPRESS -U sa -P myPassword
On successful execution of above command, you will get output like below.
Microsoft (R) ASP.NET SQL Registration Tool version 4.0.30319.33440 Administrative utility to install and uninstall ASP.NET features on a SQL server. Copyright (C) Microsoft Corporation. All rights reserved. Start adding session state. ......................... Finished.