1

After upgrading to Bootstrap 4 my autocomplete (intellisense) isn't working correctly. It's still showing Bootstrap 3.

How can I make it work with Bootstrap 4?

Troy Turley
  • 659
  • 10
  • 28

2 Answers2

5

It appears that Visual Studio gets its autocomplete data from the files in wwwroot\lib\bootstrap\dist. Refresh the files with these steps:

  • From the Project menu choose "Manage Bower Packages" Find Bootstrap, verify the version then click install
  • Delete the contents of: wwwroot\lib\bootstrap\dist
  • Copy the contents of: bower_components\bootstrap\dist to: wwwroot\lib\bootstrap\dist

You will also have to change any references in the code to point to the new version as well.

Marc LaFleur
  • 31,987
  • 4
  • 37
  • 63
Troy Turley
  • 659
  • 10
  • 28
  • 1
    Generally you would use a task manager like Gulp or WebPack to handle copying these files for you. You can also use the built-in `bundler` as well (easier but much less powerful). – Marc LaFleur Feb 05 '18 at 22:04
  • @MarcLaFleur-MSFT Does one generally set up the automation to pull major upgrades automatically or do we stay with the "safe" version until we've manually evaluated the impact? – Troy Turley Feb 06 '18 at 00:21
  • 1
    This is handled by the package manager (npm, yarn, bower), not the task runner (gulp, webpack). I use NPM or Yarn rather than Bower (Bower has stopped development) but every package manager has this functionality. With npm/yarn you can tell it to grab the latest Major version using a `^` (`^1.0.0`) or the latest Minor version using a `~` (`~1.0.0`). The task runner simply grabs whatever version was fetched from the `bower_components` or `node_modules` folder during the build. – Marc LaFleur Feb 06 '18 at 14:29
0

The following link helped me, so I am posting it here too. Actually it was asked before here, in stackoverflow

Visual Studio intellisense for Bootstrap via CDN

Guy Cohen
  • 689
  • 1
  • 9
  • 25