部署网站后,浏览器无法正确加载所有css。因此,如果我转到我的webconfig并将调试模式设置为true而不是false,我就可以使用它。
<compilation debug="true" targetFramework="4.6.2">
我做错了什么?
这是我的Bundle配置,我把所有的css用于CssRewriteUrlTransformWrapper
,因为应用程序没有正确加载属于css(Problems loading jpg after deploy of an mvc application)的图像。
无论如何,我不知道这可能是问题所在。我在本地部署应用程序并且它可以正常工作,但是当我试图将它放在我的暂存环境中时它会失败
public static void RegisterBundles(BundleCollection bundles)
{
#region JsBundles
bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
"~/Scripts/jquery-{version}.js",
"~/Scripts/jquery-ui-{version}.js",
"~/Scripts/jquery.validate.js"));
// 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 ScriptBundle("~/bundles/scriptsBundle").Include(
"~/Scripts/jquery-{version}.js",
"~/Scripts/jquery-ui-{version}.js",
"~/Scripts/jquery.validate.js",
"~/Scripts/kendo/2017.1.223/jquery.min.js",
"~/Scripts/kendo/2017.1.223/angular.min.js",
"~/Scripts/kendo/2017.1.223/jszip.min.js",
"~/Scripts/kendo/2017.1.223/kendo.all.min.js",
"~/Scripts/bootstrap.min.js",
//"http://maps.google.com/maps/api/js?sensor=true",
"~/Scripts/jquery.inview.min.js",
"~/Scripts/wow.min.js",
"~/Scripts/mousescroll.js",
"~/Scripts/smoothscroll.js",
"~/Scripts/jquery.countTo.js",
"~/Scripts/lightbox.min.js",
"~/Scripts/jquery.unobtrusive-ajax.js",
"~/Scripts/main.js"
)
);
bundles.Add(new ScriptBundle("~/bundles/toogleJs").Include(
"~/Scripts/bootstrap-toggle.js"
));
#endregion
#region CssBundle
bundles.Add(new StyleBundle("~/Content/css")
.Include("~/Content/bootstrap.css", new CssRewriteUrlTransformWrapper())
.Include("~/Content/Site.css", new CssRewriteUrlTransformWrapper()));
bundles.Add(new StyleBundle("~/Content/cssBundle")
.Include("~/Content/kendo/2017.1.223/kendo.common.min.css", new CssRewriteUrlTransformWrapper())
.Include("~/Content/kendo/2017.1.223/kendo.default.min.css", new CssRewriteUrlTransformWrapper())
.Include("~/Content/kendo/2017.1.223/kendo.default.mobile.min.css", new CssRewriteUrlTransformWrapper())
.Include("~/Content/kendo/2017.1.223/kendo.common-bootstrap.min.css",
new CssRewriteUrlTransformWrapper())
.Include("~/Content/kendo/2017.1.223/kendo.mobile.all.min.css", new CssRewriteUrlTransformWrapper())
.Include("~/Content/kendo/2017.1.223/kendo.dataviz.min.css", new CssRewriteUrlTransformWrapper())
.Include("~/Content/kendo/2017.1.223/kendo.bootstrap.min.css", new CssRewriteUrlTransformWrapper())
.Include("~/Content/kendo/2017.1.223/kendo.dataviz.bootstrap.min.css",
new CssRewriteUrlTransformWrapper())
.Include("~/Content/bootstrap.min.css", new CssRewriteUrlTransformWrapper())
.Include("~/Content/animate.min.css", new CssRewriteUrlTransformWrapper())
.Include("~/Content/font-awesome.min.css", new CssRewriteUrlTransformWrapper())
.Include("~/Content/lightbox.css", new CssRewriteUrlTransformWrapper())
.Include("~/Content/main.css", new CssRewriteUrlTransformWrapper())
.Include("~/Content/responsive.css")
.Include("~/Content/style.css", new CssRewriteUrlTransformWrapper())
.Include("~/Content/App/Receipt/receipt.css", new CssRewriteUrlTransformWrapper())
);
bundles.Add(new StyleBundle("~/bundles/toogleCss")
.Include("~/Content/bootstrap-toggle.css", new CssRewriteUrlTransformWrapper()
));
#endregion
}