Search code examples
c#asp.net-mvcbundling-and-minification

MVC C# compilation debug = true still bundling


I have a web application MVC5. For a production website we set compilatoin debug=false in the web.config. To test this I also did this on my local development machine. This works in production and locally. But now I have to develop further so i need the setting back to compilation debug=true. When i set this value and run the application my javascript is stil being bundled. I have also tried BundleTable.EnableOptimization = false, but no effect.

For more information on bundling, visit here

        public static void RegisterBundles(BundleCollection bundles)
        {
            BundleTable.EnableOptimizations = false;
            bundles.Add(new ScriptBundle("~/bundles/main").Include(
                    "~/Scripts/at/main.js",
                    "~/Scripts/at/GridAT.js",
                    "~/Scripts/at/responsive.js",
                    "~/Scripts/at/domainat.js",
                    "~/Scripts/at/fineuploaderat.js",
                    "~/Scripts/at/entitysearch.js",
                    "~/Scripts/at/atquiz.js",
                    "~/Scripts/at/jQueryExtendAT.js",
                    "~/Scripts/at/widget.js"
            ));

In web.config

<compilation targetFramework="4.5" debug="true"/>

In Layout:

 <!-- 1. Script: recourses -->
    @Scripts.Render(Url.Content("~/bundles/jquery"))
    @Scripts.Render(Url.Content("~/bundles/jqueryui"))
    @Scripts.Render(Url.Content("~/bundles/jqueryvalidation"))
    @Scripts.Render(Url.Content("~/bundles/resources"))
    @Scripts.Render(Url.Content("~/bundles/fineuploader"))
    @Scripts.Render(Url.Content("~/bundles/highcharts"))
    @Scripts.Render(Url.Content("~/bundles/mustache"))
    <script type="text/javascript" src="@Url.Content("~/scripts/tiny_mce/tiny_mce.js")"></script>
    @Scripts.Render(Url.Content("~/bundles/signalr"))

I have also checked with a coworker who does not have this issue on his computer


Solution

  • After searching for the rest of the day I decided to remove the project from disk and get it from TFS. After that it worked properly. Thank you all for responding.