2

所以突然我的asp mvc 4包停止工作:(

我被取消作为捆绑 URL 的 http 状态。

任何想法我下一步做什么?我在 _layout 中使用与工作时相同的虚拟路径

    @Styles.Render("~/foundation/stylesheets")
@Scripts.Render("~/foundation/javascripts")




public class BundleConfig
    {
        public static void RegisterBundles(BundleCollection bundles)
        {
           //JQUERY STUFF
            bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
            "~/Scripts/jquery-1.*"));

        bundles.Add(new ScriptBundle("~/bundles/jqueryplugins").Include(
            "~/Scripts/plugins/jquery.placeholder.js"));

        bundles.Add(new ScriptBundle("~/bundles/jqueryui").Include(
            "~/Scripts/jquery-ui*"));

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

        bundles.Add(new StyleBundle("~/Content/themes/base/css").Include(
            "~/Content/themes/base/jquery.ui.core.css",
            "~/Content/themes/base/jquery.ui.resizable.css",
            "~/Content/themes/base/jquery.ui.selectable.css",
            "~/Content/themes/base/jquery.ui.accordion.css",
            "~/Content/themes/base/jquery.ui.autocomplete.css",
            "~/Content/themes/base/jquery.ui.button.css",
            "~/Content/themes/base/jquery.ui.dialog.css",
            "~/Content/themes/base/jquery.ui.slider.css",
            "~/Content/themes/base/jquery.ui.tabs.css",
            "~/Content/themes/base/jquery.ui.datepicker.css",
            "~/Content/themes/base/jquery.ui.progressbar.css",
            "~/Content/themes/base/jquery.ui.theme.css"));

        //FOUNDATION STUFF
        bundles.Add(new ScriptBundle("~/foundation/javascripts").Include(
           "~/foundation/javascripts/app.js",
           "~/foundation/javascripts/foundation.min.js",
           "~/foundation/javascripts/modernizr.foundation.js"));

        bundles.Add(new StyleBundle("~/foundation/stylesheets").Include(
            "~/foundation/stylesheets/app.css",
            "~/foundation/stylesheets/foundation*"));

    }
}
4

4 回答 4

11

如果您的包路径与实际路径相同,则可能会发生这种情况。例如,您有您的 css/Content/Css并使用相同的路径构建您的包,因此:

bundles.Add(new StyleBundle("~/Content/Css").Include(
            "~/Content/Css/normalize.css",
            "~/Content/Css/main.css"
        ));
于 2013-07-18T14:02:17.977 回答
2

如果所有的都被取消,听起来你的路由表被搞砸了。使用http://nuget.org/packages/routedebugger检查它们

于 2012-12-07T22:32:54.423 回答
2

不要尝试缩小“.min”文件。从包中删除 .min 文件并使用开发文件。

于 2012-12-07T23:20:40.407 回答
2

我遇到了同样的问题,经过几天的尝试,我注意到我的 jquery 版本现在是 2.x 并且我的包正在引用 jquery-1.*。上次使用 NuGet 更新我的网站时,我确实遇到了问题。我认为崩溃导致我的包得到更新,但它没有更新我在代码中的引用。希望这可以使某人免于试图弄清楚为什么会发生在他们身上。

这是我创建应用程序时为我生成的内容:

bundles.Add(new ScriptBundle("~/bundles/jquery").Include("~/Scripts/jquery-1.*"));
于 2013-08-28T02:48:17.873 回答