Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fixing 'System.Web.Optimization.BundleCollection' does not contain a definition for 'EnableDefaultBundles' error

This error began to appear after update to the latest version of Optimization of System.Web.Optimization.

'System.Web.Optimization.BundleCollection' does not contain a definition for 'EnableDefaultBundles'

This also applies for BundleTable.Bundles.RegisterTemplateBundles();

like image 984
user2312219 Avatar asked Apr 29 '13 13:04

user2312219


1 Answers

Make sure you get the latest Microsoft Asp.Net Web Optimization Framework via the NuGet.

Verify that you have BundleConfig.cs placed in the App_Start folder and also verify that the BundleConfig.cs has its Namespace set to the application root Namespace like: namespace MeApp

In the Global.asax use BundleConfig.RegisterBundles(BundleTable.Bundles);

protected void Application_Start()
{
    ...
    BundleConfig.RegisterBundles(BundleTable.Bundles);
    ...
}
like image 94
user2312219 Avatar answered Sep 30 '22 02:09

user2312219