You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The <xref:System.Web.SessionState.HttpSessionState> object requires serialization for remote app session state.
127
+
128
+
In ASP.NET Framework, [BinaryFormatter](/dotnet/api/system.runtime.serialization.formatters.binary.binaryformatter) was used to automatically serialize session value contents. In order to serialize these with for use with the System.Web adapters, the serialization must be explicitly configured using `ISessionKeySerializer` implementations.
129
+
130
+
Out of the box, there is a simple JSON serializer that allows each session key to be registered to a known type using `JsonSessionSerializerOptions`:
131
+
132
+
*`RegisterKey<T>(string)` - Registers a session key to a known type. This registration is required for correct serialization/deserialization. Missing registrations cause errors and prevent session access.
> When using the `AddJsonSessionSerializer` registration pattern, there is no need to call `AddSessionSerializer` as it will automatically be added. If you only want to use a customimplementation, then you must manually add it.
143
+
144
+
### Enable session
145
+
146
+
Session support requires explicit activation. Configure it per-route or globally using ASP.NET Core metadata:
Choose this approach when your migrated components don't need to share session data with your legacy application.
125
159
126
160
The `Microsoft.Extensions.DependencyInjection.WrappedSessionExtensions.AddWrappedAspNetCoreSession` extension method adds a wraps ASP.NET Core session to work with the adapters. It uses the same backing store as <xref:Microsoft.AspNetCore.Http.ISession> while providing strongly-typed access.
@@ -133,8 +167,6 @@ Your Framework application requires no changes.
133
167
134
168
For more information, see the [wrapped session state sample app](https://github.com/dotnet/systemweb-adapters/blob/main/samples/SessionLocal/SessionLocalCore/Program.cs)
@@ -147,26 +179,6 @@ Remote app session enables communication between applications to retrieve and se
147
179
148
180
Complete the [remote app setup](xref:migration/fx-to-core/inc/remote-app-setup) instructions to connect your ASP.NET Core and ASP.NET Framework applications.
149
181
150
-
### Serialization configuration
151
-
152
-
The <xref:System.Web.SessionState.HttpSessionState> object requires serialization for remote app session state.
153
-
154
-
In ASP.NET Framework, [BinaryFormatter](/dotnet/api/system.runtime.serialization.formatters.binary.binaryformatter) was used to automatically serialize session value contents. In order to serialize these with for use with the System.Web adapters, the serialization must be explicitly configured using `ISessionKeySerializer` implementations.
155
-
156
-
Out of the box, there is a simple JSON serializer that allows each session key to be registered to a known type using `JsonSessionSerializerOptions`:
157
-
158
-
*`RegisterKey<T>(string)` - Registers a session key to a known type. This registration is required for correct serialization/deserialization. Missing registrations cause errors and prevent session access.
> When using the `AddJsonSessionSerializer` registration pattern, there is no need to call `AddSessionSerializer` as it will automatically be added. If you only want to use a customimplementation, then you must manually add it.
169
-
170
182
### Application configuration
171
183
172
184
:::zone pivot="manual"
@@ -200,8 +212,6 @@ var coreApp = builder.AddProject<Projects.CoreApplication>("core")
0 commit comments