Error MVC 5 Bundle

I have a big problem. I created an MVC 5 project and I cannot run it with the default code. The problem is with the kit. It stops at the Global.asax.cs / Application_Start method in the line BundleConfig.RegisterBundles(BundleTable.Bundles); . He says: "Method not found:" !! 0 [] System.Array.Empty () '. "(System.MissingMethodException).

Here is the BundleConfig.cs code (default):

 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")); } 

I am using VS 2015 Preview. What should I do / change?

Thank!

+10
asp.net-mvc bundle
Mar 12 '15 at 21:33
source share
2 answers

As Mr. Msticher notes in the comments, the problem is with compilation with .NET 4.6, but it is not an error : you can deploy the RC RC runtime to your server if you want. If you are working on Azure, this option will probably not be available until the official release of 4.6 (i.e. Not RC).

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

your application will need to run the .NET Framework 4.6 (or later). You will need to deploy the .NET Framework 4.6 RC

At the moment, itโ€™s safest not to install 4.6 unless you really need it.

+6
May 18 '15 at 9:27
source share

This will happen if .NET 4.6 is not installed on the server. If you have your own web server (not Azure), you can get the installer here . Note. Do not confuse the targeting package with the .NET installer.

+3
Aug 04 '15 at 15:11
source share



All Articles