The "System.Web.Optimization.BundleCollection" fix does not contain a definition for the "EnableDefaultBundles" error

This error started to appear after updating to the latest version of System.Web.Optimization Optimization.

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

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

+8
asp.net-mvc asp.net-mvc-4
source share
2 answers

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

Make sure that you have BundleConfig.cs located in the App_Start folder, and also make sure that the namespace for the root application namespace MeApp in the BundleConfig.cs folder, for example: namespace MeApp

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

 protected void Application_Start() { ... BundleConfig.RegisterBundles(BundleTable.Bundles); ... } 
+15
source share

If you do not have System.Web.Optimization, you can install it from the nuget package manager. Go to Tools -> nuget package manager -> package manager console and enter the following command. install-package Web.Optimization or if you have already installed and this creates a problem, you can simply update the package using the following update-package Web.Optimization

0
source share

All Articles