s.k.paul
s.k.paul

Reputation: 7291

css, js and img files can not be found in asp.net 5 mvc

I'm trying to explore Visual Studio 2015 and ASP.NET-5 MVC-6.

Project directory structure-

enter image description here

Razor view HTML

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

Browser finds no asset files. Screenshot-

enter image description here

What I'm missing here?

Upvotes: 4

Views: 799

Answers (1)

jltrem
jltrem

Reputation: 12524

Your assets folder should be moved under wwwroot.

In ASP.NET 5 all static files go under wwwroot. You can also use a Grunt or Gulp to pre-process files from your project and then place them here.

Upvotes: 1

Related Questions