microsoft / microsoft/aspire

PublishWithContainerFiles + ASP.NET Core Static Assets

Open
#19,768 4 comments 0 reactions 0 assignees View on GitHub
area-deployment area-polyglot needs-area-label triage:bot-seen
Dominant language
C#
Stars
6.3k
Forks
991
Avg merge
2d 15h
Merged PRs (30d)
196

Description

### Is your feature request related to a problem? Please describe the problem.

`PublishWithContainerFiles` (with eg. `AddViteApp` for the "[Static frontend served by a backend](https://aspire.dev/deployment/javascript-apps/#static-frontend-served-by-a-backend)"), copies files after the backend build has completed.

This means that ASP.NET Core's "[Static Asset](https://learn.microsoft.com/aspnet/core/fundamentals/static-files)" build time compression and fingerprinting doesn't include those files.

The means my static assets don't have etags and aren't compressed unless I do something (I haven't worked out exactly what yet). This should work out of the box.

### Describe the solution you'd like

Simplest would be to delay the backend build until after the front end files are copied. Not ideal.

Better would be for the fingerprinting and compression process to run as part of the copy to the container image process. Alternatively add the right dependencies to the backend build so that it waits if needed and everything continues in parallel if possible.

Maybe at least add some docs.

Contributor guide

Open the contributing guide

Research direction

Start by tracing how PublishWithContainerFiles and AddViteApp copy frontend files relative to the ASP.NET Core build. Determine where static-asset compression and fingerprinting are invoked, then validate that the copied assets receive the same processing and that the container output includes compressed, fingerprinted files; add documentation if implementation is not feasible.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, docker
Domain
backend, build-system
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.