固定'System.Web.Optimization.BundleCollection'不包含'EnableDefaultBundles“错误的定义 [英] Fixing 'System.Web.Optimization.BundleCollection' does not contain a definition for 'EnableDefaultBundles' error

查看:244
本文介绍了固定'System.Web.Optimization.BundleCollection'不包含'EnableDefaultBundles“错误的定义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

此错误开始更新System.Web.Optimization优化的最新版本后出现。

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

System.Web.Optimization.BundleCollection'不包含一
  定义EnableDefaultBundles

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

这也适用于 BundleTable.Bundles.RegisterTemplateBundles();

推荐答案

请确保您通过的NuGet获取最新的微软Asp.Net网站优化框架

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

请确认您有 BundleConfig.cs 放在 App_Start 文件夹中,也验证 BundleConfig.cs 有其命名空间设置为应用程序根目录命名空间,如:命名空间MeApp

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

在Global.asax中使用 BundleConfig.RegisterBundles(BundleTable.Bundles);

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

protected void Application_Start()
{
    ...
    BundleConfig.RegisterBundles(BundleTable.Bundles);
    ...
}

这篇关于固定'System.Web.Optimization.BundleCollection'不包含'EnableDefaultBundles“错误的定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆