– Add Bower to an ASP NET Empty application


I am creating an ASP NET MVC 5 Empty project , and I am manually adding my JavaScript references.

I have added this line:

<script src="./bower_components/angular/angular.min.js"></script>

Now my questions are: How are those packages downloaded, if I have not added Bower to the project? How can I add it?


What you need to do is install bower, the requirements are to have node, npm and git installed.

Once the requirements are installed, the command to install bower is the following:

npm install -g bower

Then you can create a bower.json file using the following command:

bower init

You must answer the questions to create a custom bower.json file.

After this you can get the angular package with the following command:

bower install angular --save

The –save flag includes the dependency in your newly created bower.json file

Also you should not reference those files within bower_components directly for many reasons, for example:

  • That route has been defined by bower and could change in the future.
  • That folder should not be displayed as it contains many possibly unnecessary files.

What you should do is copy the files you need using some task runner like gulp or grunt .

Scroll to Top