Not able to install bootstrap 4 (beta) nuget package to .Net MVC (.Net version 4.6.2)

Viewed 8455

I am not able to install bootstrap 4(beta) to my MVC project. To be precise popper.js nuget dependency is failing to install. Please let me know any possible way to do it(bower install is still a way but I want to go with nuget)

Could not install package 'popper.js 1.11.0'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.6.2', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author

9 Answers

Before installing the package using NuGet, expand "Options" and change the "Dependency Behavior" to "Highest". Now when you install the package the latest popper.js will get installed first allowing bootstrap to get installed as well.

This prevented me from having to install popper separately.

For uses of ASP.NET Webforms:

I've created a new Project with preinstalled Packages (Bootstrap, Popper, jQuery), updated them to the newest version and did:

  1. add to App_Start/BundleConfig.cs

    bundles.Add(new ScriptBundle("~/bundles/popper").Include(
              "~/Scripts/umd/popper.js"));
    
  2. Add to Header (Master Page)

    <asp:PlaceHolder runat="server"> <%: Scripts.Render("~/bundles/popper") %> <%: Scripts.Render("~/bundles/bootstrap")%> </asp:PlaceHolder>

Related