In Visual Studio 2015, I've added, for example, "angular" as a dependency in bower.json. When I go into Dependencies -> Bower I see angular in the list except it says not installed next to it. Right-clicking on Bower and clicking "Restore packages" removes the "not installed" next to angular, however I don't actually have any angular files added to my wwwroot. Am I missing an extra step here?
-
2For whatever reason, restarting Visual Studio makes the files get added to my lib folder – girlcode Jan 26 '15 at 01:31
-
I'll try to reproduce this tomorrow. Are you on beta 2? – Carrie Kendall Jan 26 '15 at 01:43
5 Answers
Thomas is correct! I ran into the same problem and found that you need to use your Grunt File to run the Bower task. For example, right-click on your Grunt file and choose Task Runner Explorer
Next, right-click on the Bower task and Run.
Once the task is finished running, you will notice the packages have been copied to your wwwroot.

- 2,805
- 3
- 29
- 42
-
To save manual running, bind to a Visual Studio event: http://docs.asp.net/en/latest/client-side/using-grunt.html#binding-to-visual-studio-events – fiat Jul 27 '15 at 00:15
-
1I don't have grunt i have gulp and no bower task. What can I do? – Mihai Bratulescu Sep 24 '15 at 09:16
-
'gulp' is not recognized as an internal or external command, when i run task on bower – Hassan Abbas Oct 20 '16 at 13:15
The package files are installed into a folder called "bower_components" in your project directory. The folder is hidden in the Visual Studio solution explorer. It's meant to be a cache of downloaded package files.
Typically you would setup grunt or gulp tasks to copy or process only the files you need from the package to somewhere under wwwroot.
For example if you install bootstrap using bower you might setup a task to compile and concat the LESS source files with your app's LESS files, or alternatively you might just setup a task to copy the pre-compiled .css files from the bower_components\bootstrap\dest folder.
This post shows how to use bower and grunt together. http://www.asp.net/vnext/overview/aspnet-vnext/grunt-and-bower-in-visual-studio-2015

- 169
- 4
On vs 2015 go >Tools>Options>Projects and Solutions>External Web Tools Make sure $(DevEnvDir)\Extensions\Microsoft\Web Tools\External\git checked If you didn't find it, add it
:) close vs2015 n open it, then restoring process will success

- 51
- 4
Those who are having trouble to use bower in ASP.NET Core 1.0. Please check this out. The problem is due to Git installation path.

- 1
- 1

- 387
- 2
- 10
-
Thanks! One day trying to solve things with ASP.Net Core 1.0. Bypassing version check in the installer... Reinstalling NuGet... And now this... I hope I can start working now. – Fernando de Bem Jul 24 '16 at 00:30
I had this exact issue, bower packages empty after cloning the solution on a clean machine. Tried right-click sorcery to no avail. The only thing that worked was running bower manually like this (change your VS install path as needed):
"C:\Program Files (x86)\Microsoft Visual Studio 14.0\Web\External\bower.cmd" install -f

- 1,090
- 11
- 12