After I installed bootstrap using nuget package manager, Bootstrap files don't show in my wwwroot directory and I can't reference bootstrap in my HTML files. I am new to .Net so I am kinda lost. I have watched tons of videos on YouTube and every time someone installs bootstrap all files just shows up in solution explorer.
-
It should add the files into the scripts and styles folders. Have you checked the folder to see if they're actually there, and just not included in the solution for some reason?Reinstate Monica Cellio– Reinstate Monica Cellio2019-07-15 11:13:48 +00:00Commented Jul 15, 2019 at 11:13
-
nope there is no files under wwwroot/css or wwwroot/js folders, but in dependencies/NuGet i can see bootstrap(4.3.1)Aidanas Naugžemis– Aidanas Naugžemis2019-07-15 11:24:25 +00:00Commented Jul 15, 2019 at 11:24
-
Check the solution folder, not the deployment folder.Reinstate Monica Cellio– Reinstate Monica Cellio2019-07-15 11:24:57 +00:00Commented Jul 15, 2019 at 11:24
-
imgur.com/a/jeOMcMI dont really understand there to lookAidanas Naugžemis– Aidanas Naugžemis2019-07-15 11:30:44 +00:00Commented Jul 15, 2019 at 11:30
-
Right-click the project name "EmptyProject" and select "Open Folder in File Explorer". Have a look in the actual folder that way, not just the Solution Explorer. That doesn't show everything in the project folder - only things you add to the solution. This is unlikely to fix your problem, but you need to know if it has unzipped the package contents into the correct folders or not. Also, have you built the project since you included the package?Reinstate Monica Cellio– Reinstate Monica Cellio2019-07-15 11:33:29 +00:00Commented Jul 15, 2019 at 11:33
1 Answer
The client-side library NuGet packages are for ASP.NET MVC, not ASP.NET Core. Core uses an entirely different methodology for managing client-side libraries.
In Core, you need to use either LibMan (the default client-side library manager provided by Microsoft) or npm (the Node.js package manager). While npm requires a bit more effort, as you'll need to combine it with something like webpack or gulp, it is the preferred approach and also more complete and extensible. LibMan, while easy, is not complete. It relies entirely on cdnjs.cloudflare.com, so if the library doesn't exist there, you're out of luck. While there's a very large amount of libraries covered, it is not exhaustive, and you'll likely run into one thing or another that you can't obtain. At that point, you'll have to fallback to npm, anyways, so you might as well just use it for everything.