Skip to content

Conversation

@VedikaGupt
Copy link

@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
Author

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

@CZEMacLeod
Copy link

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
Author

Thanks for pointing that out @CZEMacLeod!!

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

2 participants