Skip to content

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

@ralencar84

Description

@ralencar84

Description

The Samples contains:
`protected void Application_Start()
{
HttpApplicationHost.RegisterHost(builder =>
{
builder**.AddSystemWebAdapters()**
.AddRemoteAppServer(options =>
{
// ApiKey is a string representing a GUID
options.ApiKey = System.Configuration.ConfigurationManager.AppSettings["RemoteAppApiKey"];
});
});

// ...existing code...

}`

The correct version should be:

`protected void Application_Start()
{
HttpApplicationHost.RegisterHost(builder =>
{
builder**.Services.AddSystemWebAdapters()**
.AddRemoteAppServer(options =>
{
// ApiKey is a string representing a GUID
options.ApiKey = System.Configuration.ConfigurationManager.AppSettings["RemoteAppApiKey"];
});
});

// ...existing code...

}`

Page URL

https://learn.microsoft.com/en-gb/aspnet/core/migration/fx-to-core/inc/remote-app-setup?view=aspnetcore-10.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 - 547910

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions