-
Notifications
You must be signed in to change notification settings - Fork 25.1k
[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
Conversation
Note:
I built up a very detailed action plan in the issue, and with the additions I made to the copilot instructions, I'm testing to see if Copilot can pull this off, or at least much of it.
...Host Co-authored-by: wadepickett <10985336+wadepickett@users.noreply.github.com>
@copilot, verify if changes are required to match the new code in the topic that includes the code here:
aspnetcore/migration/fx-to-core/inc/remote-app-setup.md
If changes are needed proceed with making them and summarize in the discussion what was changed and why. If no changes are needed state why.
@copilot, verify if changes are required to match the new code in the topic that includes the code here:
aspnetcore/migration/fx-to-core/inc/remote-app-setup.md
If changes are needed proceed with ma...
No changes are required. The authentication.md file is already consistent with the updated code from remote-app-setup.md.
Verification details:
- Line 190 of authentication.md includes the code snippet from
AspNetApp.csusing:::codedirective - The AspNetApp.cs sample was already updated in commit 0be7549 to use the new
HttpApplicationHost.RegisterHostAPI - Line 182 references the remote-app-setup instructions, which were also updated in the same commit
- Session.md similarly includes the updated Global.asax.cs sample
- No inline code examples in either file contain the obsolete API
All documentation files that reference the remote app setup code are automatically pulling in the updated samples via the :::code directives, so they display the correct new API pattern.
@twsouthwick, could use your review on this migration doc sample update.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed and approved.
Let's hold for a few days - we're planning on releasing the version that has this, but it's a prerelease version at the moment.
Otherwise, the changes look good!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait to align for GA release (when no longer preview))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has been released and the update LGTM
Uh oh!
There was an error while loading. Please reload this page.
Summary
This PR updates the ASP.NET Framework configuration examples to use the current
HttpApplicationHost.RegisterHostAPI instead of the obsoleteSystemWebAdapterConfiguration.AddSystemWebAdapters(this)method, which generates warning CS0618 in recent versions of the SystemWebAdapters library.Problem
The documentation was instructing users to use an obsolete API that causes the following compiler warning:
This affected users following the remote app setup guide for incremental ASP.NET Framework to ASP.NET Core migrations.
Changes
Updated all instances of the obsolete API pattern across documentation and sample code:
Before:
After:
Files Modified
aspnetcore/migration/fx-to-core/inc/remote-app-setup.md- Updated manual setup instructions and metadataaspnetcore/migration/fx-to-core/areas/authentication/samples/AspNetApp.cs- Updated authentication sampleaspnetcore/migration/fx-to-core/areas/session/samples/remote/Global.asax.cs- Updated session sampleAll changes maintain consistency with the Aspire section pattern already present in the documentation.
Related Issue
Fixes #[issue number] - CS0618 warning about obsolete SystemWebAdapterConfiguration API
Original prompt
This section details on the original issue you should resolve
<issue_title>SystemWebAdapterConfiguration.AddSystemWebAdapters(HttpApplication)' is obsolete: 'Prefer using HttpApplicationHost.RegisterHost(...) instead</issue_title>
<issue_description>### 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:
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
Related Issues</issue_description>
Comments on the Issue (you are @copilot in this section)
@wadepickett Thanks for bringing this up @cas-matt! Greatly appreciated. We will fix it.Triage notes and draft action plan:
Issue Summary
This is a valid issue. The article "Remote app setup" instructs users to use
SystemWebAdapterConfiguration.AddSystemWebAdapters(this)inGlobal.asax.csfor ASP.NET Framework configuration. As of the latest SystemWebAdapters packages, this API is obsolete and emits CS0618, advising use ofHttpApplicationHost.RegisterHost(...)instead. The article does not reflect this change and needs to be updated to prevent confusion and ensure best practices.Action Items
aspnetcore/migration/fx-to-core/inc/remote-app-setup.mdlines 59–73 and any other occurrences of the obsolete API.Details for Action Plan
Files Impacted
Configure ASP.NET Framework ApplicationRequired Changes
1. Replace obsolete API usage
Current code (lines 62–73):
Replace with: