Core.AspNet.Web.SessionState
1.0.0.26281
dotnet add package Core.AspNet.Web.SessionState --version 1.0.0.26281
NuGet\Install-Package Core.AspNet.Web.SessionState -Version 1.0.0.26281
<PackageReference Include="Core.AspNet.Web.SessionState" Version="1.0.0.26281" />
<PackageVersion Include="Core.AspNet.Web.SessionState" Version="1.0.0.26281" />
<PackageReference Include="Core.AspNet.Web.SessionState" />
paket add Core.AspNet.Web.SessionState --version 1.0.0.26281
#r "nuget: Core.AspNet.Web.SessionState, 1.0.0.26281"
#:package Core.AspNet.Web.SessionState@1.0.0.26281
#addin nuget:?package=Core.AspNet.Web.SessionState&version=1.0.0.26281
#tool nuget:?package=Core.AspNet.Web.SessionState&version=1.0.0.26281
AspNetCore.Web.SessionState
Out-of-process session state: <sessionState mode="StateServer"> and mode="SQLServer", with the
web.config you already have.
<PackageReference Include="AspNetCore.Web.SessionState" Version="1.0.0" />
Not needed for mode="InProc", which AspNetCore.Web.Base handles on its own.
Assembly vs package name. The package is
AspNetCore.Web.SessionState; the assembly inside it isCore.Web.SessionState. .NET ships an emptySystem.Web.dllfacade inMicrosoft.NETCore.Appand the host gives the shared framework precedence, so an app-localSystem.Web.dllis never loaded — the port therefore cannot use the original assembly names. Namespaces are unchanged, so your code andInherits=attributes are unaffected; onlyweb.configentries that name an assembly need updating.
Usage
var builder = WebApplication.CreateBuilder (args);
// mode="StateServer" only. AddDistributedMemoryCache () for a single instance.
builder.Services.AddStackExchangeRedisCache (o => o.Configuration = "localhost:6379");
var app = builder.Build ();
app.UseWebFormsSessionState (); // BEFORE UseWebForms
app.UseWebForms (options => { /* ... */ });
UseWebFormsSessionState is a no-op for InProc and Off, so it is safe to call unconditionally.
It exists because the session store is built by the provider model — Activator.CreateInstance on a
type named in configuration — which has no access to dependency injection.
Neither store is the one the words used to mean
| Mode | What actually stores the session |
|---|---|
StateServer |
The IDistributedCache you registered — Redis, SQL Server, NCache, in-memory. Not aspnet_state.exe; stateConnectionString is ignored. |
SQLServer |
The stock ASPState database, through its standard stored procedures. An existing aspnet_regsql-provisioned database needs no DDL. |
Mono's own implementations could not be used: its StateServer handler is built on .NET Remoting, a CLR feature CoreCLR does not have, and its SQL handler targets a Mono-invented table through a SQLite factory this port excludes.
For a new ASPState database, aspnet_regsql.exe does not exist on .NET 10 — the script ships in
the assembly:
Console.WriteLine (SqlSessionStateStore.GetSchemaScript ()); // for a DBA to review
SqlSessionStateStore.EnsureSchema (connectionString); // or run it directly; idempotent
Four things to know
- Existing session data does not migrate. Sessions written by .NET Framework contain
BinaryFormatterpayloads and .NET 9+ cannot read them. Reuse the Redis instance or the database — the infrastructure — but treat the cutover as a session flush. - Everything in
Sessionmust now serialize.InProcnever wrote a session down, so a type that has worked for years can fail the first time the mode changes, with no other edit. The failure names both the type and the mode. - StateServer locking is best-effort.
IDistributedCachehas no compare-and-swap, so two simultaneous requests for one session can both believe they hold the lock; the result is last-writer-wins, not corruption.SQLServerhas no such window. Session_Endnever fires under either mode. OnlyInProccould ever raise it.
Under SQLServer, schedule dbo.DeleteExpiredSessions yourself — nothing reads expired rows, so
skipping it costs disk rather than correctness.
Documentation
PORTING-GUIDE.md (step-by-step migration from IIS) and LIMITATIONS.md (what differs from ASP.NET
on .NET Framework, and why) ship in the repository.
Licence
MIT, as the upstream Mono sources this is built from and the code written for this port.
THIRD-PARTY-NOTICES.md ships in the package and says which part is which.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Core.AspNet.Web.Forms (>= 1.0.0.26281)
- Microsoft.Data.SqlClient (>= 6.1.6)
- System.Configuration.ConfigurationManager (>= 9.0.11)
-
net6.0
- Core.AspNet.Web.Forms (>= 1.0.0.26281)
- Microsoft.Data.SqlClient (>= 6.1.6)
- System.Configuration.ConfigurationManager (>= 9.0.11)
-
net8.0
- Core.AspNet.Web.Forms (>= 1.0.0.26281)
- Microsoft.Data.SqlClient (>= 6.1.6)
- System.Configuration.ConfigurationManager (>= 9.0.11)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0.26281 | 94 | 10/8/2026 |