microsoft / microsoft/aspire

JavaScript templates with ASP.NET Core backend and Aspire doesn't orchestrate the client project.

Open
#10,782 2 comments 1 reaction 0 assignees View on GitHub
needs-area-label
Dominant language
C#
Stars
6.3k
Forks
991
Avg merge
2d 15h
Merged PRs (30d)
196

Description

_This issue has been moved from [a ticket on Developer Community](https://developercommunity.visualstudio.com/t/JavaScript-templates-with-ASPNET-Core-b/10888412)._

---
\[severity:It’s more difficult to complete my work\]
I am creating an Angular front end with an ASP.NET Core backend and I decided to use the Angular and ASP.NET Core template. This template will:

* Generate an Angular project with the Angular CLI (ng)
* Create a JavaScript project (e.g. angular1.client.esproj)
* Generate an ASP.NET Web Api with the default weatherforecast service (e.g. Angular1.Server.csproj).
* Add a reference from the Server project to the client project.
* Modify the default Angular project to proxy HTTP calls for /weatherforecast to the backend server on the specific ports the the backend runs on.

This works pretty well out of the box.

The template’s wizard has a checkbox to Enlist in .NET Aspire orchestration.

When using that option the generated AppHost project has a project reference to the ASP.NET Core API server project but not the Angular client project - this may be expected but there is also no call to builder. AddNpmApp either.

It is not that there are no adjustments for Aspire being made to the client project - there are.

When you select the Enlist in .NET Aspire orchestration checkbox, the client and server projects have differences from the non-Aspire version.

* The client project’s .vscode\\launch.json uses the `DEV_SERVER_PORT` environment variable instead of hardcoding the port used by the server project.
* The client project’s .vscode\\launch.json adds a preLaunchTask to run `npm: start`.
* The .vscode\\tasks.json is completely different.
* The client project’s src\\proxy.conf.js file uses `env["services__angularapp1-server__https__0"]` as the default target for the proxy configuration.
* The client project’s package.json start:windows and start:default scripts add `--port %DEV_SERVER_PORT%` and `--port $DEV_SERVER_PORT` respectively.
* The server project doesn’t refrence the `Microsoft.AspNetCore.SpaProxy` package and doesn’t set the `SpaRoot` , `SpaProxyLaunchCommand`, and `SpaProxyServerUrl` properties.
* The server project’s launchSettings.json do not add the `ASPNETCORE_HOSTINGSTARTUPASSEMBLIES` environment variable.
* The server project’s Program.cs adds code to execute `builder. AddServiceDefaults()` and `app.MapDefaultEndpoints()`.

So it seems like there is some code missing from the AppHost project’s Program.cs file.

---
### Original Comments

#### Feedback Bot on 4/10/2025, 07:53 PM:

We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.

#### Feedback Bot on 7/10/2025, 07:09 PM:

We detected that this issue hasn’t received a lot of activity, votes, or comments in the past 90 days. Based on this, the issues severity and affected area, it’s my experience that this issue is unlikely to get fixed. To improve the situation, consider following best practices for quality problem reports, and giving us more details on how this issue is impacting you.

Contributor guide

Open the contributing guide

Research direction

Compare the Aspire and non-Aspire generated projects, starting with the AppHost project's Program.cs and the client and server files listed in the report. Determine how the generated AppHost should include the Angular client, then verify that the client and ASP.NET Core server are both orchestrated and that the proxy works through the generated configuration.

Written by the indexing model from the issue text.

Assessment

Tech stack
angular, csharp, javascript
Domain
backend, devops, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.