MVC 5捆绑错误

GSe*_*usB 10 asp.net-mvc bundle

我有一个大问题.我创建了一个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"));
        }
Run Code Online (Sandbox Code Playgroud)

我正在使用VS 2015 Preview.我该怎么做/改变?

谢谢!

Tim*_*les 6

正如Mrchief在评论中所说,问题是由于针对.NET 4.6进行编译,但这并不是一个错误:如果您愿意,可以在服务器上部署4.6 RC运行时.如果您在Azure中运行,则在4.6正式发布(即不是RC)之前,此选项可能无法使用.

来自http://blogs.msdn.com/b/dotnet/archive/2015/05/08/targeting-the-net-framework-4-6-rc.aspx:

您的应用程序将需要运行.NET Framework 4.6(或更高版本).您将需要部署.NET Framework 4.6 RC

目前最安全的是不要瞄准4.6,除非你真的需要它.