Hi I am trying to bundle my scripts for my application. My debug is working and if I publish with the Web.debug every thing works fine. But when I publish with the Web.releas my scripts don't load. Everything works locally it only stops when I publish to Azure from VS2012. Here is how I create my bundles.
namespace BAT.App_Start
{
public class BundleConfig
{
public static void RegisterBundles(BundleCollection bundles)
{
//BundleTable.EnableOptimizations = true;
bundles.Add(new ScriptBundle("~/Content/MasterCss")
.Include("~/Content/bootstrap.css")
.Include("~/Content/bootstrap-responsive.css")
.Include("~/Content/CSS/site.css"));
bundles.Add(new ScriptBundle("~/Scripts/MasterScripts")
.Include("~/Scripts/jquery-{version}.js")
.Include("~/Scripts/bootstrap.js"));
bundles.Add(new ScriptBundle("~/Scripts/Validation")
.Include("~/Scripts/jquery.validate.js")
.Include("~/Scripts/jquery.validate.unobtrusive.js"));
}
}
}
The un-commented line breaks the debug build
This is my layout where I call the bundles
@using System.Web.Optimization
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>@ViewBag.Title Business Analysis Tool </title>
@Styles.Render("~/Content/MasterCss")
</head>
<body>
<div class="container-fluid">
<div class="row-fluid"> @RenderPage("~/Views/Shared/_Header.cshtml") </div>
<div class="row-fluid"> @RenderBody() </div>
<div class="row-fluid"> @RenderPage("~/Views/Shared/_Footer.cshtml") </div>
</div>
@Scripts.Render("~/Scripts/MasterScripts")
@RenderSection("scriptholder", false)
</body>
</html>
This is my Release.Config
<?xml version="1.0"?>
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<system.web>
<compilation xdt:Transform="RemoveAttributes(debug)" />
</system.web>
</configuration>
Here is a link to the error when I check the bundled script with CTRL+U on the page http://bat.azurewebsites.net/Content/MasterCss?v=htASNz4hgFFA40tt0CVZdpwQudN8ZW4429UjRQZQJms1
It seems to be something to do with minification. I've followed some tutorials and have read other posts here but their solutions arn't working for me