Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7606087
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T00:19:24+00:00 2026-05-31T00:19:24+00:00

I am new to MVC so thought I would start a new project and

  • 0

I am new to MVC so thought I would start a new project and try out some of the new features in MVC4. I have two css files in my Content directory, normalise_mini and site.css. When I use the following code:

<link href="@System.Web.Optimization.BundleTable.Bundles.ResolveBundleUrl("~/Content/css")" rel="stylesheet" type="text/css" />

It only takes my site.css file not my normalisation file. I have the following in my app start:

protected void Application_Start()
{

    // Remove all other view engines except razor:
    ViewEngines.Engines.Clear();
    ViewEngines.Engines.Add(new RazorViewEngine());

    AreaRegistration.RegisterAllAreas();

    RegisterGlobalFilters(GlobalFilters.Filters);
    RegisterRoutes(RouteTable.Routes);

    BundleTable.Bundles.RegisterTemplateBundles();
    BundleTable.Bundles.EnableDefaultBundles();
}

Do I need to create a bundle for each css file (as this person is doing)? Or should it just find all the css files automatically (which I would expect to be the default behaviour). It might be worth noting that I started this project as a Empty Website based on Razor view engine (which actually wasn’t empty at all :/)

Thanks in advance


Update

According to the link posted, I need to comment out the line that registers the template bundles. Eg:

protected void Application_Start()
{

    // Remove all other view engines except razor:
    ViewEngines.Engines.Clear();
    ViewEngines.Engines.Add(new RazorViewEngine());

    AreaRegistration.RegisterAllAreas();

    RegisterGlobalFilters(GlobalFilters.Filters);
    RegisterRoutes(RouteTable.Routes);

    //BundleTable.Bundles.RegisterTemplateBundles();  // This is not needed
    BundleTable.Bundles.EnableDefaultBundles();
}

This now works. My thoughts are that the two lines should co-exist without any problems. I guess it’s by design, but is it bad design?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T00:19:25+00:00Added an answer on May 31, 2026 at 12:19 am

    Someone else has already answered this question:

    http://forums.asp.net/t/1776599.aspx/1?MVC+4+0+Bundling+Minification+not+working+

    UPDATE:

    Someone has expressed concern that a link may not be enough to answer the question. Although I still believe that someone who visits this page should read the linked thread, the short answer is to remove the BundleTable.Bundles.RegisterTemplateBundles() line from Application_Start() and replace it with BundleTable.Bundles.EnableDefaultBundles()

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to start a new MVC project with tests and I thought
I have started a new mvc project and clicked on project\properties\web - use local
I thought it would be interesting if I could use the new MVC Razor
New to MVC, so hopefully this will be pretty simple. I have an HTML
Pretty new to MVC and the like. I have a class the looks like
I am new to MVC and EF and I have a question. I have
I'm going to start a new project which is going to be small initially
I'm about to start working on a new project at a somewhat new job,
I'm new to DDD. I have an existing ASP.NET application (not MVC) and I
I am new to ASP.NET MVC. I am trying to create what I thought

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.