无法将Bootstrap 4(beta)nuget软件包安装到.Net MVC(.Net版本4.6.2) [英] Not able to install bootstrap 4 (beta) nuget package to .Net MVC (.Net version 4.6.2)

查看:133
本文介绍了无法将Bootstrap 4(beta)nuget软件包安装到.Net MVC(.Net版本4.6.2)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法将Bootstrap 4(测试版)安装到我的MVC项目中.确切地说,popper.js nuget依赖项无法安装.请让我知道任何可行的方式(仍然是bower install,但我想使用nuget)

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)

无法安装软件包"popper.js 1.11.0".您正在尝试 将此软件包安装到针对的项目中 '.NETFramework,Version = v4.6.2',但该软件包不包含任何 与之兼容的程序集引用或内容文件 框架.有关更多信息,请与软件包作者联系.

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

推荐答案

通过执行以下操作,我终于能够使Bootstrap 4-Beta正常工作:

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

1.)安装popper.js NuGet软件包V1.12.3

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

2.)安装Bootstrap4-beta NuGet软件包

2.) Install Bootstrap4-beta NuGet Package

3.)更新您的BundleConfig.cs以包括以下内容:注意popper.js路径

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"));

由于某些原因,如果您尝试在\Scripts文件夹的根目录中使用popper.js,则会收到错误消息:

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

,但是/Scripts/umd中的版本似乎可以正常工作.

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

这篇关于无法将Bootstrap 4(beta)nuget软件包安装到.Net MVC(.Net版本4.6.2)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆