Visual Studio 2013不会更新缩小的bootstrap.css

时间:2014-09-14 21:14:58

标签: css asp.net-mvc twitter-bootstrap visual-studio-2013

bootstrap.css文件的部分:

中的ASP .NET MVC 5.1应用程序中
@media (min-width: 768px) {
  .dl-horizontal dt {
    float: left;
    width: 160px;
    overflow: hidden;
    clear: left;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .dl-horizontal dd {
    margin-left: 180px;
  }

我将width: 160px;更改为width: 260px;,将margin-left: 180px;更改为margin-left: 280px;

我保存,重新加载,稍后重新启动Visual Studio。在我的Chrome网站中,我检查了加载的样式:

.dl-horizontal dt {
float: left;
width: 160px; //STILL 160px !
overflow: hidden;
clear: left;
text-align: right;
text-overflow: ellipsis;
white-space: nowrap;
}

所以我通过Visual Studio检查了bootstrap.min.css,我看到我对bootstrap.css所做的更改未应用于bootstrap.min.css,因此我将其手动应用于缩小的文件和Chrome正确加载它们。

如何让VS2013更新这个缩小的文件?


编辑:我必须说在VS2013(今天)之后在boostrap.min.css进行更改后更新了boostrap.css。在这些变化之后,它没有这样做。

using System.Web;
using System.Web.Optimization;

namespace WebApplication2 {
    public class BundleConfig {
        // For more information on bundling, visit http://go.microsoft.com/fwlink/?LinkId=301862
        public static void RegisterBundles(BundleCollection bundles) {
            bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
                        "~/Scripts/jquery-{version}.js"));

            bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(
                        "~/Scripts/jquery.validate*"));

            // Use the development version of Modernizr to develop with and learn from. Then, when you're
            // ready for production, use the build tool at http://modernizr.com to pick only the tests you need.
            bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(
                        "~/Scripts/modernizr-*"));

            bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include(
                      "~/Scripts/bootstrap.js",
                      "~/Scripts/respond.js"));

            bundles.Add(new StyleBundle("~/Content/css").Include(
                      "~/Content/bootstrap.css",
                      "~/Content/site.css"));

            // Set EnableOptimizations to false for debugging. For more information,
            // visit http://go.microsoft.com/fwlink/?LinkId=301862
            BundleTable.EnableOptimizations = true;
        }
    }
}

1 个答案:

答案 0 :(得分:1)

min文件在重建后更新。强制重建以更新min.css文件。如果你删除bootstrap.min.css然后重建项目,我会很好奇。