【问题标题】:Bundling fails because path mistaken for a controller path捆绑失败,因为路径被误认为是控制器路径
【发布时间】:2013-11-25 14:12:26
【问题描述】:

在我的 BundleConfig 我有

bundles.Add(new StyleBundle("~/Content/css/css").Include("~/Content/css/wireframe.css?v=1.0"));

在我看来我有

@Styles.Render("~/Content/css/css")

但是当我访问相关页面时,我得到一个 404 并出现此错误

[HttpException]: The controller for path '/Content/css/css' was not found or does not implement IController.

似乎控制器的路径被混淆了。我要更改我的 WebApiConfig 和 RouteConfig 文件吗?

【问题讨论】:

    标签: asp.net-mvc-4 bundling-and-minification


    【解决方案1】:

    小学生错误。我在 Global.asax 中错过了这个

    BundleConfig.RegisterBundles(BundleTable.Bundles);
    

    【讨论】:

    • 谢谢我也错过了!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-06-24
    • 2012-10-15
    • 2012-10-10
    • 2016-07-09
    • 2019-05-09
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多