I've played with this a bit more and it seems if I click on the wwwroot folder in the solution and choose Add Client Libraries from there, it all works as expected. I'm not sure why it is not working from the project root which is how the article I linked to suggested it should be done - maybe it's a problem specific to my installation of Visual Studio?
Add Client Side Library not working
Hi,
I'm trying to add the Bootstrap client side library to my ASP.NET Core 7 Web application in Visual Studio 2022 (17.4.3). However I cannot get it to work. I can get the dialog box up, enter in the details i.e. cdnjs, type Bootstrap into the library box (the latest version appears). I leave Include all library files selected, choose a suitable target location e.g. wwwroot/lib/ then click on install. Once I do this, absolutely nothing happens. No files are created in the folders specified under wwwroot.
I have tried creating the folders first. No change.
I see from the documentation here: https://learn.microsoft.com/en-us/aspnet/core/client-side/libman/libman-vs?view=aspnetcore-7.0 that there is a Library Manager Feed window. I cannot find it anywhere. There is absolutely no output on any of the output windows I can select - Build, Build Order, Package Manager, Razer Language Service Clients, Service Dependences, Tests.
Clearly something is going wrong but without being able to see any output from the process I'm a bit stuck. Does anyone know how I can trouble shoot this issue?
Many thanks,
Damien
Developer technologies Visual Studio Other
5 answers
Sort by: Most helpful
-
-
Khurram Rahim 1,851 Reputation points Volunteer Moderator
2023-02-08T11:04:16.6866667+00:00 Try the following steps to troubleshoot the issue:
- Check if you have the latest version of .NET Core SDK installed on your machine.
- Try to install Bootstrap manually using npm by running the following command in the terminal: "npm install bootstrap".
- If the manual installation fails, try reinstalling the NuGet packages in your project.
- If the issue still persists, you can try to install the library using the Library Manager directly from the terminal. You can use the following command: "libman install bootstrap@latest -p cdn -d wwwroot/lib".
If none of these steps resolve the issue, you can try to use the older version of Visual Studio or create a new ASP.NET Core project and see if the problem still persists.
-
Zin Min 0 Reputation points
2023-04-07T03:54:40.8766667+00:00 Dear @Damien
Because of Visual Studio is downloading client-side library which you tried to add. Before finishing the downloading and adding process to your project, VS disable the Add > Client-side Library ... menu and Manage Client-side Libraries ... menu.
Please wait a while, after some period, you can see the library package inside your project and both menus will be enabled.
If necessary, you can unload the project and then reload project with dependencies. Hope this will help your problem. Regards, Zin
-
Antalek, Whitaker Steven 0 Reputation points
2024-01-03T19:52:59.7433333+00:00 I was running into this same issue. Turns out I had to open my project with VS 2022 (it defaults to opening with 2019). I end up forgetting what I opened it up with to start the project as my company has use for both 2019 and 2022 I don't have a standard yet.
As soon as I switched which vs version I was using I was able to install the bootstrap Client Side Library
-
Andrew Kolesnyk 1 Reputation point
2024-08-01T20:18:17.92+00:00 Got the same problem. None of previous suggestions worked. I end-up downloading sources from website (https://www.npmjs.com/package/jquery-validation?activeTab=code in my case) and placed them manually in wwwroot/lib folder.