Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Wait for GA] Update SystemWebAdapters API from obsolete AddSystemWebAdapters to HttpApplicationHost.RegisterHost #36198

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Copilot wants to merge 2 commits into main
base: main
Choose a base branch
Loading
from copilot/update-system-web-adapter-usage
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,16 @@ protected void Application_Start()
BundleConfig.RegisterBundles(BundleTable.Bundles);

// <snippet_SystemWebAdapterConfiguration>
SystemWebAdapterConfiguration.AddSystemWebAdapters(this)
.AddProxySupport(options => options.UseForwardedHeaders = true)
.AddRemoteAppServer(options =>
{
options.ApiKey = ConfigurationManager.AppSettings["RemoteAppApiKey"];
})
.AddAuthenticationServer();
HttpApplicationHost.RegisterHost(builder =>
{
builder.AddSystemWebAdapters()
.AddProxySupport(options => options.UseForwardedHeaders = true)
.AddRemoteAppServer(options =>
{
options.ApiKey = ConfigurationManager.AppSettings["RemoteAppApiKey"];
})
.AddAuthenticationServer();
});
// </snippet_SystemWebAdapterConfiguration>
}
}
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,19 @@ public class Global : HttpApplication
{
protected void Application_Start()
{
SystemWebAdapterConfiguration.AddSystemWebAdapters(this)
.AddJsonSessionSerializer(options =>
{
// Serialization/deserialization requires each session key to be registered to a type
options.RegisterKey<int>("test-value");
options.RegisterKey<SessionDemoModel>("SampleSessionItem");
})
// Provide a strong API key that will be used to authenticate the request on the remote app for querying the session
// ApiKey is a string representing a GUID
.AddRemoteAppServer(options => options.ApiKey = ConfigurationManager.AppSettings["RemoteAppApiKey"])
.AddSessionServer();
HttpApplicationHost.RegisterHost(builder =>
{
builder.AddSystemWebAdapters()
.AddJsonSessionSerializer(options =>
{
// Serialization/deserialization requires each session key to be registered to a type
options.RegisterKey<int>("test-value");
options.RegisterKey<SessionDemoModel>("SampleSessionItem");
})
// Provide a strong API key that will be used to authenticate the request on the remote app for querying the session
// ApiKey is a string representing a GUID
.AddRemoteAppServer(options => options.ApiKey = ConfigurationManager.AppSettings["RemoteAppApiKey"])
.AddSessionServer();
});
}
}
17 changes: 10 additions & 7 deletions aspnetcore/migration/fx-to-core/inc/remote-app-setup.md
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: Remote app setup
author: wadepickett
ms.author: wpickett
monikerRange: '>= aspnetcore-6.0'
ms.date: 09/16/2025
ms.date: 10/08/2025
ms.topic: article
uid: migration/fx-to-core/inc/remote-app-setup
zone_pivot_groups: migration-remote-app-setup
Expand Down Expand Up @@ -61,12 +61,15 @@ To configure the application to be available to handle the requests from the ASP
```CSharp
protected void Application_Start()
{
SystemWebAdapterConfiguration.AddSystemWebAdapters(this)
.AddRemoteAppServer(options =>
{
// ApiKey is a string representing a GUID
options.ApiKey = ConfigurationManager.AppSettings["RemoteAppApiKey"];
});
HttpApplicationHost.RegisterHost(builder =>
{
builder.AddSystemWebAdapters()
.AddRemoteAppServer(options =>
{
// ApiKey is a string representing a GUID
options.ApiKey = System.Configuration.ConfigurationManager.AppSettings["RemoteAppApiKey"];
});
});

// ...existing code...
}
Expand Down

AltStyle によって変換されたページ (->オリジナル) /