dotnet / dotnet/aspnetcore

MapStaticAssets returns empty files when used with <Content Link=... />

Open
#63,570 13 comments 2 reactions 0 assignees View on GitHub
area-blazor investigate
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 6h
Merged PRs (30d)
290

Description

### Is there an existing issue for this?

- [x] I have searched the existing issues

### Describe the bug

When adding assets to the `wwwroot` folder using ``, they are correctly fingerprinted and recognized through `@Assets`, but they return blank content:

Image

This does work correctly after publishing

### Expected Behavior

Assets added through `` are fingerprinted and the correct content is returned

### Steps To Reproduce

Repro added here:
https://github.com/TomGathercole/contentlinkrepro

* Run `dotnet new blazor -ai -int Auto`
* Add a new css file outside of wwwroot
* Add a `` inside wwwroot, and add the styles to `App.razor` using `@Assets` syntax

### Exceptions (if any)

_No response_

### .NET Version

_No response_

### Anything else?

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.