【发布时间】:2013-07-10 21:20:21
【问题描述】:
我们在 MVC3 应用程序中使用 LESS 代码捆绑,一切正常。 在我们的 RegisterBundles() 中,我们有如下代码:
var bundle = new
Bundle("~/assets/styles/EnhancedLayoutLess")
.Include("~/assets/styles/enhanced-layout.less");
bundle.Transforms.Add(new CssTransformer());
BundleTable.Bundles.Add(bundle);
但是在升级到 MVC4 和最新版本的 BundleTransformer:Core (1.6.28)、BundleTransfomer:LESS (1.6.26) 和 Microsoft ASP.NET Web Optimization Framework (1.1.0) 后,当我们尝试检索捆绑包时我们得到以下错误:
找不到方法: 'System.Collections.Generic.IEnumerable`1 System.Web.Optimization.BundleResponse.get_Files()'。
[MissingMethodException:找不到方法: 'System.Collections.Generic.IEnumerable
1<System.IO.FileInfo> System.Web.Optimization.BundleResponse.get_Files()'.]1 bundleFiles) +198
BundleTransformer.Core.Transformers.TransformerBase.Process(BundleContext context, BundleResponse response) +0
System.Web.Optimization.Bundle.ApplyTransforms(BundleContext context, String bundleContent, IEnumerable
System.Web.Optimization.Bundle.ProcessRequest(BundleContext 上下文) +269 System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +913 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +165
有什么建议我应该检查什么?或者如何让 LESS 捆绑在 MVC4 下工作?
【问题讨论】:
标签: asp.net-mvc-4 less bundling-and-minification