'Custom CSS file styles not being read by ASP.NET Core 5 MVC project

I have a custom CSS file site.css (which is returning 200 when running the project) I started with a blank ASP.NET Core 5 web application and added MVC functionality in, so I added Bootstrap js/css files and jQuery manually.

When I try to run the project, none of the site.css styles show up but there are styles from a file called scaffolding.less, which Chrome Dev Tools says is located in lib/bootstrap/css/less/. I can't find any less file in the bootstrap/css folder, so I'm not sure where that is coming from, unless it's added at runtime. I've included the head element code of the _Layout.cshtml. Any ideas as to why the site.css styles aren't being added?

<head>
    <meta name="viewport" content="width=device-width" />
    <title>@ViewBag.Title</title>
    <link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro">
    <link href="~/lib/bootstrap/css/bootstrap.css" rel="stylesheet" />
    <script src="~/lib/jquery/jquery.js"></script>
    <script src="~/lib/bootstrap/js/bootstrap.js"></script>
    <link href="~/content/site.css" rel="stylesheet" />
</head>

Here's part of the site.css file (bootstrap is making the background white, but it should be the picture from the url() repeating (I put the !important in after to try if it would override anything):

body {
    padding-top: 70px; /* Required padding for .navbar-fixed-top. Remove if using .navbar-static-top. Change if height of navigation changes. */
    background-image: url('/images/pattern.png') !important;
    background-repeat: repeat;
    font-family: 'Source Sans Pro', sans-serif;
}

Here's a brief view of the wwwroot hierarchy:

enter image description here



Sources

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

Source: Stack Overflow

Solution Source