dotnet / dotnet/aspnetcore

Static assets doesn't serve content files that are linked from a location outside of the project

Open
#51,392 7 comments 0 reactions 0 assignees View on GitHub
area-ui-rendering bug feature-static-web-assets Pillar: Technical Debt
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 6h
Merged PRs (30d)
290

Description

When creating a Razor Class Library, files that are linked to `wwwroot` from a different physical location, e.g. a `Shared` directory one level up from the class library project, result in a 404 when requested via the usual `_content/MyRazorClassLib/FileName` path.

*MyRazorClassLib.csproj*
```csproj


net8.0
enable
enable







```

*Component1.razor*
```razor


This component is defined in the MyRazorClassLib library.

Linked file


Physical file




```

image

image

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.