ASP.NET MVC Bundle not rendering script files on staging server. It works on development server

前端 未结 8 1606
感动是毒
感动是毒 2020-11-28 05:48

In our ASP.NET MVC 4 web application, our BundleConfig.cs includes the following:

bundles.Add(new ScriptBundle(\"~/bundles/jquery\").Include(
                        


        
8条回答
  •  温柔的废话
    2020-11-28 06:36

    Whenever I set debug="off" in my web.config and run my mvc4 application i would end up with ...

    in my html code and a JavaScript error

    Expected ';'

    There were 2 ways to get rid of the javascript error

    1. set BundleTable.EnableOptimizations = false in BundleConfig.cs

    OR

    1. I ended up using NuGet Package Manager to update WebGrease.dll. It works fine irrespective if debug= "true" or debug = "false".

提交回复
热议问题