Skip to content

SystemWebAdapterConfiguration.AddSystemWebAdapters(HttpApplication)' is obsolete: 'Prefer using HttpApplicationHost.RegisterHost(...) insteadΒ #36197

@cas-matt

Description

@cas-matt

Description

Hi Wade

Step 2 in Configure ASP.NET Framework Application is out of date. It generates a

warning CS0618: 'SystemWebAdapterConfiguration.AddSystemWebAdapters(HttpApplication)' is obsolete: 'Prefer using HttpApplicationHost.RegisterHost(...) instead'

I believe the code should be something like this:

        HttpApplicationHost.RegisterHost(builder =>
        {
            builder.AddServiceDefaults();
            builder.RegisterWebObjectActivator();

            builder.AddSystemWebAdapters()
                   .AddVirtualizedContentDirectories();
            builder.AddSystemWebAdapters()
                        .AddRemoteAppServer(options =>
                        {
                            // ApiKey is a string representing a GUID
                            options.ApiKey = System.Configuration.ConfigurationManager.AppSettings["RemoteAppApiKey"];
                        });
        });

Also, we are having trouble trying to get the recipe to work. We have adapted the https://github.com/dotnet/systemweb-adapters/tree/main sample to work using a domain setup (have set up two domains as framework.noho.ca and core.noho.ca) on our dev machines. We can log in to framework and then when we try to load the core app, it does not pick up the login details even though it does have the shared cookie. There are no errors and we are a bit fuzzy regarding the communication mechanism between the two.

Do you know of any example code which show the domain version using the manual setup? We got the Aspire version to run from the sample using the local host and the dashboard and could see login in the core app, and are trying to get a version running that we could apply to our main app. It is a very large project with a million lines of combined code.

Page URL

https://learn.microsoft.com/en-us/aspnet/core/migration/fx-to-core/inc/remote-app-setup?view=aspnetcore-9.0&pivots=manual

Content source URL

https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/migration/fx-to-core/inc/remote-app-setup.md

Document ID

f3b2ce81-5438-1d1a-1c2b-6cc9a089a0ea

Platform Id

f8610778-e458-a8a6-8136-0ee8c72f11e8

Article author

@wadepickett

Metadata

  • ID: f3b2ce81-5438-1d1a-1c2b-6cc9a089a0ea
  • PlatformId: f8610778-e458-a8a6-8136-0ee8c72f11e8
  • Service: aspnet-core
  • Sub-service: migration

Related Issues


Associated WorkItem - 498818

Metadata

Metadata

Labels

Source - Docs.msDocs Customer feedback via GitHub Issueaspnet-core/svcbreaking-changesAnything related to breaking changes that need to be documented or fixed.migration/subsvcseQUESTeredIdentifies that an issue has been imported into Quest.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions