1 minute read

In VS 2017, you have the option to install UI components using Bower. If you have previously worked on an ASP.NET MVC project in Visual Studio, you know that NuGet was our go-to tool for installing everything from jQuery to Newtonsoft.Json.

To use Bower, right-click on your project and select "Manage Bower Packages." This option appears right next to "Manage NuGet Packages."

The Bower package manager window looks very similar to the NuGet window. Note that for back-end library dependencies, you should still use NuGet.

Is there a way to install packages by just typing, like in NuGet?

The great thing about Bower is that it maintains a bower.json file in your project's root directory, which you can edit directly. For example, if I need to install Moment.js in my .NET Core project, here is how easy it is:

Open bower.json and start typing "moment" under dependencies. Once you place the cursor after the colon, it will show you all available versions. Doesn't that sound both convenient and cool?

You will notice that some version numbers start with ~ and others with ^. If you want to understand what those symbols mean and how they work, please refer to this Stack Overflow question: http://stackoverflow.com/questions/19030170/what-is-the-bower-and-npm-version-syntax

Thanks for reading! Happy coding Smile