Library Manager is a lightweight, client-side library acquisition tool. Developers can retrieve libraries like jQuery, bootstrap, Vue.js, and others from various supported CDNs or even the file system.
It's not to replace with package management like npm, yarn, rather, just to fetch client side library files and to place them in the project file.
If we are developing a modern web app, chances are your app will reference client-side JavaScript and CSS files like jQuery or bootstrap. Maybe you copy these from a previous project, download them, or use Bower. However, Bower has announced they won’t be offering support in the future.
That’s the reason for a lightweight, effective solution for web developers to easily manage common client-side library files. It is Visual Studio’s experimental client-side library acquisition tool.
Library files can be added to an ASP.NET Core project in two different ways:
- Use the Add Client-Side Library dialog
- Manually configure LibMan manifest file entries
Use the Add Client-Side Library dialog
Place them in your project.
Select the library provider from the provider dropdown. CDNJS is the default provider.
Type the library name to fetch in the library text box. IntelliSense provides a list of libraries beginning with the provided text.
- Select the Include all library files radio button to include all of the library's files.
- Select the Choose specific files radio button to include a subset of the library's files.
To open libman.json for editing, the following options exist,
- Double-click the libman.json file in Solution Explorer.
- Right-click the project in Solution Explorer and select Manage Client-Side Libraries.
- Select Manage Client-Side Libraries from the Visual Studio Project menu.
LibMan manifest file
IntelliSense provides a list of libraries beginning with the provided @ symbol.
Add library files
Clean Client-Side Libraries - To perform the clean operation, which deletes library files previously restored in Visual Studio
Restore Client-Side Libraries - To restore library files from within Visual Studio, there must be a valid libman.json file in the project root. Restored files are placed in the project at the location specified for each library.
First, we are going to clean client side libraries,
Check here if bootstrap content was deleted,
To get back what was cleaned earlier, do restore? Click on restore,
Restore files during the build
Uninstall library files
Clicking the icon opens a tooltip listing the known background tasks.
Update library version