In our ASP.NET MVC 4 web application, our BundleConfig.cs includes the following:
bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
"~/Scripts/jquery-{version}.js"));
bundles.Add(new ScriptBundle("~/bundles/jqueryui").Include(
"~/Scripts/jquery-ui-{version}.js"));
bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(
"~/Scripts/jquery.unobtrusive*",
"~/Scripts/jquery.validate*"));
bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(
"~/Scripts/modernizr-*"));
When we look at the html of the home page on development server, we can see the following script tags even though the debug mode in web.config is set to true as <compilation debug="true" targetFramework="4.0" />
:
<script src="/AFR/Scripts/jquery-ui-1.8.20.min.js"></script>
<script src="/AFR/Scripts/modernizr-2.5.3.js"></script>
<script src="/AFR/Scripts/jquery-1.7.1.js"></script>
<script src="/AFR/Scripts/jquery-ui-1.8.20.js"></script>
<script src="/AFR/Scripts/jquery.unobtrusive-ajax.js"></script>
<script src="/AFR/Scripts/jquery.validate.js"></script>
<script src="/AFR/Scripts/jquery.validate.unobtrusive.js"></script>
But when we deploy the app on staging server and look at the html (View Source) of the home page, all of the above script tags with the exception of <script src="/AFR/Scripts/jquery-ui-1.8.20.min.js"></script>
are missing. We've verified that all the files mentioned in these tags are in the script folder. The folder structure is exactly the same as on development machine. On staging server, the web.config fie has <compilation targetFramework="4.0" />
which means, by default, the debug="false".
As a result, some of the JavaScript functions are failing on staging server. Both the staging and development machines are Windows 2012.
Please help. Thanks.