Css, js and img files cannot be found in asp.net 5 mvc

I am trying to learn Visual Studio 2015 and ASP.NET-5 MVC-6.

Project Directory Structure -

enter image description here

HTML Shaver View

<!DOCTYPE html>
<html>
   <head>
      <link href="~/assets/css/bootstrap.min.css" rel="stylesheet">    
      ... ... ...
   </head>
   <body>
     ... ... ...
   </body>
</html>

The browser cannot find asset files. Screenshot -

enter image description here

What am I missing here?

+4
source share
1 answer

Your folder assetsshould be moved to wwwroot.

In ASP.NET 5, all static files are under wwwroot. You can also use Grunt or Gulp to preprocess files from your project, and then put them here.

+1
source

Source: https://habr.com/ru/post/1599099/


All Articles