Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at

  • Chad Rosenthal 272 posts 474 karma points
    Feb 23, 2013 @ 17:49
    Chad Rosenthal

    Using MVC 4's bundling and minification

    I'm trying to use MVC 4's bundling and optimization features. They seem more standard and easier to use then client dependency's options.

    I updated umbracoReservedPaths with the virtual path that I used in bundling.

    Then updated the global.asax with:



    And created the following class in App_Start.

        public class BundleConfig
            public static void RegisterBundles(BundleCollection bundles)
                bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include(
                bundles.Add(new StyleBundle("~/bundles/baseCSS").Include(


    Now my masterlayout.cshtml contains:

    @using System.Web.Optimization
    @inherits Umbraco.Web.Mvc.UmbracoTemplatePage
        Layout = null;

    But it just renders out a url and not the actual files.


  • gary 385 posts 915 karma points
    Feb 23, 2013 @ 18:45

    Hi Chad

    I am running VS2012, if you have this, right-click on the folder you want to bundle/minify, web essentials (you may need to install if not already there), then minify css or create bundle, creates new folder, drap and drop into -Layout and that's it. The folder created allows you to add / subtract so no need to worry too much)

    Don't know of another way, but that route is simple enough.

    Hope it helps G



  • Chad Rosenthal 272 posts 474 karma points
    Feb 23, 2013 @ 18:51
    Chad Rosenthal

    looks like it was probably a configuration issue. I reinstalled twitter bootstrap from nuget and updated the web optimization framework, and then it started to work.


  • Tim 166 posts 347 karma points
    Mar 12, 2013 @ 08:51

    Just in case anyone else stumbles across this issue and wonders what's going on, in your snippet above you were registering routes not the bundles:


    Should have been:

Please Sign in or register to post replies

Write your reply to: