diff --git a/aspnetcore/migration/fx-to-core/areas/authentication/samples/AspNetApp.cs b/aspnetcore/migration/fx-to-core/areas/authentication/samples/AspNetApp.cs index 2a6524a53ceb..9015b3ed0016 100644 --- a/aspnetcore/migration/fx-to-core/areas/authentication/samples/AspNetApp.cs +++ b/aspnetcore/migration/fx-to-core/areas/authentication/samples/AspNetApp.cs @@ -14,13 +14,16 @@ protected void Application_Start() BundleConfig.RegisterBundles(BundleTable.Bundles); // - 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(); + }); // } } \ No newline at end of file diff --git a/aspnetcore/migration/fx-to-core/areas/session/samples/remote/Global.asax.cs b/aspnetcore/migration/fx-to-core/areas/session/samples/remote/Global.asax.cs index 30d640292a11..89073fe84f52 100644 --- a/aspnetcore/migration/fx-to-core/areas/session/samples/remote/Global.asax.cs +++ b/aspnetcore/migration/fx-to-core/areas/session/samples/remote/Global.asax.cs @@ -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("test-value"); - options.RegisterKey("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("test-value"); + options.RegisterKey("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(); + }); } } diff --git a/aspnetcore/migration/fx-to-core/inc/remote-app-setup.md b/aspnetcore/migration/fx-to-core/inc/remote-app-setup.md index 17d4b31d2e2d..f5037eade436 100644 --- a/aspnetcore/migration/fx-to-core/inc/remote-app-setup.md +++ b/aspnetcore/migration/fx-to-core/inc/remote-app-setup.md @@ -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 @@ -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... }