0

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

jps
  • 15,760
  • 14
  • 59
  • 71
  • Hi @Serious Down, Add as link doesn't work for your requirement. you can check this answer here: https://stackoverflow.com/a/36599280/11398810. – Rena Mar 04 '22 at 07:12

0 Answers0