'ASP.NET Core Connect a style using a link from another project

Connected the style file via "Add > Existing item > Add link"

  <ItemGroup>
    <Content Include="..\WebApplication2\wwwroot\css\site2.css" Link="wwwroot\css\site2.css">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </Content>
  </ItemGroup>

Added to _Layout.cshtml

<link rel="stylesheet" href="~/css/site2.css"/>

The problem is that when building in the wwwroot folder, I see a file with styles, but in the browser this file is empty and, accordingly, the style is not loaded. Link to the source code: https://github.com/Slogg/WebAppStyleLinkTest In project WebApplication3, I connect style site2.css from project WebApplication2



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source