Using Bower to add the Bootstrap 4 files

In order to use Bootstrap 4 in your project, you first need to add the Bootstrap style sheet and JavaScript files. In this example, you'll use Bower to download the Bootstrap 4 files to your local project:

  1. Add a new file called bower.json to the root of your project folder and set its content to the following in order to add Bootstrap 4 as a dependency:
            { 
              "name": "ASP.NET", 
              "private": true, 
              "dependencies": { 
                "bootstrap": "4.0" 
              } 
            } 
    
  2. In order to download any Bower dependencies, you'll need to open a new command prompt in your project folder—this can be done from within Visual Studio Code using the keyboard shortcut Shift + Ctrl + C.
  3. Enter the following command ...

Get Bootstrap for ASP.NET MVC - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.