【发布时间】:2015-03-12 21:33:11
【问题描述】:
我有一个大问题。我创建了一个 MVC 5 项目,但无法使用默认代码启动它。问题在于捆绑。它在 Global.asax.cs/Application_Start 方法的 BundleConfig.RegisterBundles(BundleTable.Bundles); 行中停止。
它说“找不到方法:'!!0 [] System.Array.Empty()'。” (System.MissingMethodException)。
这是BundleConfig.cs 代码(默认):
public static void RegisterBundles(BundleCollection bundles)
{
bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
"~/Scripts/jquery-{version}.js"));
bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(
"~/Scripts/jquery.validate*"));
// Use the development version of Modernizr to develop with and learn from. Then, when you're
// ready for production, use the build tool at http://modernizr.com to pick only the tests you need.
bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(
"~/Scripts/modernizr-*"));
bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include(
"~/Scripts/bootstrap.js",
"~/Scripts/respond.js"));
bundles.Add(new StyleBundle("~/Content/css").Include(
"~/Content/bootstrap.css",
"~/Content/site.css"));
}
我正在使用 VS 2015 预览版。我应该做什么/改变?
谢谢!
【问题讨论】:
-
这似乎是 .Net 4.5.3 或 .Net 4.6 中的一个错误。根据 4.5.2 编译它可以正常工作。
-
@Mrchief 也为我做了这件事
标签: asp.net-mvc bundle