File tree Expand file tree Collapse file tree 3 files changed +34
-25
lines changed
aspnetcore/migration/fx-to-core Expand file tree Collapse file tree 3 files changed +34
-25
lines changed Original file line number Diff line number Diff line change @@ -14,13 +14,16 @@ protected void Application_Start()
1414 BundleConfig . RegisterBundles ( BundleTable . Bundles ) ;
1515
1616 // <snippet_SystemWebAdapterConfiguration>
17- SystemWebAdapterConfiguration . AddSystemWebAdapters ( this )
18- . AddProxySupport ( options => options . UseForwardedHeaders = true )
19- . AddRemoteAppServer ( options =>
20- {
21- options . ApiKey = ConfigurationManager . AppSettings [ "RemoteAppApiKey" ] ;
22- } )
23- . AddAuthenticationServer ( ) ;
17+ HttpApplicationHost . RegisterHost ( builder =>
18+ {
19+ builder . AddSystemWebAdapters ( )
20+ . AddProxySupport ( options => options . UseForwardedHeaders = true )
21+ . AddRemoteAppServer ( options =>
22+ {
23+ options . ApiKey = ConfigurationManager . AppSettings [ "RemoteAppApiKey" ] ;
24+ } )
25+ . AddAuthenticationServer ( ) ;
26+ } ) ;
2427 // </snippet_SystemWebAdapterConfiguration>
2528 }
2629}
Original file line number Diff line number Diff line change @@ -2,16 +2,19 @@ public class Global : HttpApplication
22{
33 protected void Application_Start ( )
44 {
5- SystemWebAdapterConfiguration . AddSystemWebAdapters ( this )
6- . AddJsonSessionSerializer ( options =>
7- {
8- // Serialization/deserialization requires each session key to be registered to a type
9- options . RegisterKey < int > ( "test-value" ) ;
10- options . RegisterKey < SessionDemoModel > ( "SampleSessionItem" ) ;
11- } )
12- // Provide a strong API key that will be used to authenticate the request on the remote app for querying the session
13- // ApiKey is a string representing a GUID
14- . AddRemoteAppServer ( options => options . ApiKey = ConfigurationManager . AppSettings [ "RemoteAppApiKey" ] )
15- . AddSessionServer ( ) ;
5+ HttpApplicationHost . RegisterHost ( builder =>
6+ {
7+ builder . AddSystemWebAdapters ( )
8+ . AddJsonSessionSerializer ( options =>
9+ {
10+ // Serialization/deserialization requires each session key to be registered to a type
11+ options . RegisterKey < int > ( "test-value" ) ;
12+ options . RegisterKey < SessionDemoModel > ( "SampleSessionItem" ) ;
13+ } )
14+ // Provide a strong API key that will be used to authenticate the request on the remote app for querying the session
15+ // ApiKey is a string representing a GUID
16+ . AddRemoteAppServer ( options => options . ApiKey = ConfigurationManager . AppSettings [ "RemoteAppApiKey" ] )
17+ . AddSessionServer ( ) ;
18+ } ) ;
1619 }
1720}
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ description: Remote app setup
44author : wadepickett
55ms.author : wpickett
66monikerRange : ' >= aspnetcore-6.0'
7- ms.date : 09/16 /2025
7+ ms.date : 10/08 /2025
88ms.topic : article
99uid : migration/fx-to-core/inc/remote-app-setup
1010zone_pivot_groups : migration-remote-app-setup
@@ -61,12 +61,15 @@ To configure the application to be available to handle the requests from the ASP
6161 ``` CSharp
6262 protected void Application_Start ()
6363 {
64- SystemWebAdapterConfiguration .AddSystemWebAdapters (this )
65- .AddRemoteAppServer (options =>
66- {
67- // ApiKey is a string representing a GUID
68- options .ApiKey = ConfigurationManager .AppSettings [" RemoteAppApiKey" ];
69- });
64+ HttpApplicationHost .RegisterHost (builder =>
65+ {
66+ builder .AddSystemWebAdapters ()
67+ .AddRemoteAppServer (options =>
68+ {
69+ // ApiKey is a string representing a GUID
70+ options .ApiKey = System .Configuration .ConfigurationManager .AppSettings [" RemoteAppApiKey" ];
71+ });
72+ });
7073
7174 // ...existing code...
7275 }
You can’t perform that action at this time.
0 commit comments