9

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.

7
  • 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? Commented 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) Commented Jul 15, 2019 at 11:24
  • Check the solution folder, not the deployment folder. Commented Jul 15, 2019 at 11:24
  • imgur.com/a/jeOMcMI dont really understand there to look Commented 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? Commented Jul 15, 2019 at 11:33

1 Answer 1

7

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.