我有一个包含引导的ASP.NET MVC应用程序。我的目录结构如下所示:在带有Bootstrap捆绑的ASP.NET MVC应用程序中使用Glyphicons
/
/App_Start
BundleConfig.cs
/Content
app.css
bootstrap.min.css
/Fonts
glyphicons-halflings-regular.eot
glyphicons-halflings-regular.svg
glyphicons-halflings-regular.ttf
glyphicons-halflings-regular.woff
glyphicons-halflings-regular.woff2
我需要将Bootstrap捆绑到我的应用程序中。在我的BundleConfig.cs文件中,我有以下内容:
public static void RegisterBundles(BundleCollection bundles)
{
bundles.Add(new StyleBundle("~/public/bundles/css")
.Include("~/Content/bootstrap.min.css")
.Include("~/Content/app.css")
);
bundles.Add(new ScriptBundle("~/public/bundles/scripts")
.Include("~/Scripts/jquery-2.1.4.min.js")
.Include("~/Scripts/jquery-ui-1.11.4.min.js")
.Include("~/Scripts/bootstrap.min.js")
.Include("~/Scripts/jquery.validate.min.js")
.Include("~/Scripts/jquery.validate.unobtrusive.min.js")
);
}
当捆绑关闭时,一切都呈现良好。当我打开打包时,一切都呈现良好,,除了用于字体图标。当我查看控制台窗口时,发现5 404个与字体图标相关的错误。它就像它尝试引用的字体文件类似如下:
http://localhost:9090/public/fonts/glyphicons-halflings-regular.woff2
然而,他们没有在公共目录中。我不知道如何解决这个问题。