5Managing Dependencies with NuGet and Bower

The previous chapters showed that modern software development, both front‐end and server‐side, is based on small and very focused components that can be composed as needed.

Unfortunately, while it is good to avoid the monolithic frameworks of the past, this new approach introduces a problem: how do you manage all these components? Components usually depend on other components, which depend on yet other components, which depend… well, you got the idea. To make things more difficult, there might be a component, let’s call it A, that depends on component B, but also another component, C, that also depends on B, but a different version of it. And on top of this, all components must be kept up‐to‐date. Finally, in some cases, to correctly install a component, additional operations might be needed, like compiling some native library or changing some configuration files.

Fortunately, all these tasks are automated by specific tools that are called package managers. In the context of front‐end development with ASP.NET Core MVC, there are three package managers you need to know:

  • NuGet, for managing .NET libraries
  • Bower, for managing client‐side (JavaScript and CSS) libraries
  • NPM, for managing the installation of tools used during the development

The rest ...

Get Front-end Development with ASP.NET Core, Angular, and Bootstrap now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.