Skip to content

System.Web.HttpContext.Session is null with SystemWebAdapters v1.3.0 on .Net 8 after upgrading the 1.20 version on .Net 6. #455

Closed
@sgarnovsky

Description

@sgarnovsky

Originally I'd already created a project using .Net 6 and SystemWebAdapters using version 1.2.0 and it worked fine.

After migrating to the .Net 8 and SystemWebAdapters 1.3.0 (nuget package) Session from the System.Web.HttpContext is returned as a null reference.

Initialization code is:

services.AddSystemWebAdapters()
.AddSessionSerializer()
.AddMssAdminSessionSerializer()
.AddRemoteAppClient(options =>
{
options.RemoteAppUrl = new(Configuration.GetMigrationLegacyAppAddress());
options.ApiKey = Configuration.GetMigrationRemoteAPIKey();
})
.AddSessionClient();

app.MapRazorPages()
.RequireSystemWebAdapterSession();

One thing I see that this github project refers 1.2.0 version only. It is possible the 1.3.0 has changed initialization steps or maybe just moved the source to another place?

So for now, I just downgraded the SystemWebAdapters packages back to 1.2.0 version. Confirmed the Session sharing works fine under .Net 8 in this case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    In-PRIssues that have a PR open for them.Needs: Triage 🔍Label added to new issues which need Triage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions