Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 318
Debananda Avatar asked Aug 14 '17 01:08

Debananda


1 Answers

I was finally able to get Bootstrap 4-Beta working by doing the following:

1.) Install the popper.js NuGet Package V1.12.3

2.) Install Bootstrap4-beta NuGet Package

3.) Update your BundleConfig.cs to include the following: Note the popper.js path

bundles.Add(new ScriptBundle("~/Scrpts/Bootstrap").Include(
                             /*** Make sure popper.js is pointing to umd ***/
                             "~/Scripts/umd/popper.js", 
                             "~/Scripts/bootstrap.js",
                             ));

bundles.Add(new StyleBundle("~/CSS/Bootstrap").Include(
                            "~/Content/bootstrap.css"));

For some reason if you try to use the popper.js in the root of the \Scripts folder you will receive the error:

SyntaxError: export declarations may only appear at top level of a module

but the version in the /Scripts/umd seems to work.

like image 112
Andy Braham Avatar answered Oct 04 '22 18:10

Andy Braham