-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Open
Labels
Pillar: Technical Debtarea-ui-renderingIncludes: MVC Views/Pages, Razor Views/PagesIncludes: MVC Views/Pages, Razor Views/PagesbugThis issue describes a behavior which is not expected - a bug.This issue describes a behavior which is not expected - a bug.feature-static-web-assets
Milestone
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
<Project Sdk="Microsoft.NET.Sdk.Razor">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<ItemGroup>
<Content Include="..\Shared\MyIcon.ico" Link="wwwroot\MyIcon.ico" />
</ItemGroup>
<ItemGroup>
<SupportedPlatform Include="browser" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="8.0.0-rtm.23512.10" />
</ItemGroup>
</Project>
Component1.razor
<div class="my-component">
This component is defined in the <strong>MyRazorClassLib</strong> library.<br />
<h4>Linked file</h4>
<img src="_content/MyRazorClassLib/MyIcon.ico" />
<h4>Physical file</h4>
<img src="_content/MyRazorClassLib/MyIconPhysical.ico" />
</div>


Metadata
Metadata
Assignees
Labels
Pillar: Technical Debtarea-ui-renderingIncludes: MVC Views/Pages, Razor Views/PagesIncludes: MVC Views/Pages, Razor Views/PagesbugThis issue describes a behavior which is not expected - a bug.This issue describes a behavior which is not expected - a bug.feature-static-web-assets