Skip to content

[WebToolsE2E] Using VS Code C# Dev Kit, when we add Aspire orchestration to web app, it missed adding some lines of code in Program.cs of the AppHost and web app projects #7937

Open
@balachir

Description

@balachir

REGRESSION INFO: Not a regression

INSTALL STEPS

  1. Clean machine: Win11 x64 ENU
  2. Install SDK 9.0.200 (latest-released-version)
  3. Install Aspire templates 9.1 (latest-released-version)
    • dotnet new install Aspire.ProjectTemplates
  4. Install VS Code + C# Dev Kit extension (latest pre-release version 1.17.48)

REPRO STEPS

  1. Using VS Code, create new 9.0 ASP.NET Web App (Razor Pages) > WebAppRp01

  2. In Solution Explorer, right-click solution node > Add .NET Aspire Orchestration > select WebAppRp01 as the project to be orchestrated

    • Image
  3. For the names of AppHost and ServiceDefaults projects, set the values to be WebAppRp01.AppHost and WebAppRp01.ServiceDefaults.

ACTUAL
Aspire orchestration support gets added but it is incomplete

  1. In the Program.cs of WebAppRp01.AppHost, the critical line of adding the web app project to the IDistributedApplicationBuilder is missing. Without this line, the dashboard will be blank when we run the AppHost.

    • Image
  2. In the Program.cs of WebAppRp01.AppHost, the lines of builder.AddServiceDefaults and builder.MapDefaultEndpoints are missing

    • Image

EXPECTED
Missing orchestration support code should get properly added

  1. In the Program.cs of WebAppRp01.AppHost, we should add the web app project to the IDistributedApplicationBuilder as follows.

    • Image
  2. In the Program.cs of WebAppRp01.AppHost, the lines of builder.AddServiceDefaults and builder.MapDefaultEndpoints are missing

    • Image

Metadata

Metadata

Labels

area-toolingvs-codeIssues related to vs code tooling for aspire

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions