Skip to content

Fix System.Web Adapters service registration syntax in documentation#36679

Merged
wadepickett merged 5 commits into
dotnet:mainfrom
VedikaGupt:fix-systemwebadapters-services-syntax
Jan 26, 2026
Merged

Fix System.Web Adapters service registration syntax in documentation#36679
wadepickett merged 5 commits into
dotnet:mainfrom
VedikaGupt:fix-systemwebadapters-services-syntax

Conversation

@VedikaGupt
Copy link
Copy Markdown
Contributor

@VedikaGupt VedikaGupt commented Jan 24, 2026

PR Description:
This PR corrects the syntax for registering System.Web Adapters services in the HttpApplicationHost.RegisterHost context. The AddSystemWebAdapters() method is an extension on IServiceCollection, so it should be called as builder.Services.AddSystemWebAdapters() instead of builder.AddSystemWebAdapters().

Fixes: #36520


Internal previews

📄 File 🔗 Preview link
aspnetcore/migration/fx-to-core/inc/remote-app-setup.md Remote app setup

@VedikaGupt
Copy link
Copy Markdown
Contributor Author

@dotnet-policy-service agree company="Microsoft"

@CZEMacLeod
Copy link
Copy Markdown

I'm not sure this is correct -

public static ISystemWebAdapterBuilder AddSystemWebAdapters(this IHostApplicationBuilder builder)

Also the method uses builder.Configuration as well as builder.Services, so it needs access to both, at least on version 2.2.1.
This change also contradicts the readme in the package.

https://github.com/dotnet/systemweb-adapters/blob/main/src/Microsoft.AspNetCore.SystemWebAdapters.FrameworkServices/README.md

@VedikaGupt
Copy link
Copy Markdown
Contributor Author

Thanks for pointing that out @CZEMacLeod!!

Comment thread aspnetcore/migration/fx-to-core/inc/remote-app-setup.md Outdated
Updated the doc date.
@wadepickett
Copy link
Copy Markdown
Contributor

Thank you @VedikaGupt and @CZEMacLeod!!!

@wadepickett wadepickett merged commit 31df823 into dotnet:main Jan 26, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wrong syntax when setting-up SystemWebAdapters using HttpApplicationHost in AspNet .Net Framework

3 participants