Bootstrap Icons not showing in published ASP.NET MVC application

后端 未结 17 2016
孤城傲影
孤城傲影 2021-01-30 11:30

--- NB: Go to the EDITED 2 section for summary ----

I have an ASP.NT MVC (4) application. I integrated (twitter)Bootstrap to it. Bootstrap is working perfectly, but the

17条回答
  •  面向向阳花
    2021-01-30 11:46

    Try disabling bundle optimizations, what happens is that the path to the bundled css stylesheet conflicts with referenced images. For example. You might have a css file /Content/css/style.css => in a bundle "~/Content/css" in which an image is specified as such

        .someclass { background-image:url(img/someimg.png) }
    

    This would resolve the image to /Content/css/img/someimg.png

    Now you deploy the release build and the css file is now rendered to a bundle URL such as /Content/css Now the image URL resolves to /Content/img/someimg.png

    You can change this behaviour in App_Start\BundleConfig.cs

        System.Web.Optimization.BundleTable.EnableOptimizations = false;
    

提交回复
热议问题