I have tried implementing Bundling in Asp.net webform projects. My Bundleconfig:
System.Web.Optimization.BundleTable.Bundles.Add(new System.Web.Optimization.ScriptBundle("~/bundle/LoginPageJS")
.Include("~/assets/js/jquery-1.11.2.min.js", "~/assets/bootstrap/js/bootstrap.min.js", "~/assets/js/validatr.js", "~/assets/js/jquery.placeholder.js"));
System.Web.Optimization.BundleTable.Bundles.Add(new System.Web.Optimization.StyleBundle("~/bundle/LoginPageCSS")
.Include("~/assets/bootstrap/css/bootstrap.css", "~/assets/styles/stylesheet.css",
"~/assets/styles/non-responsive.css", "~/assets/styles/Window.css", "~/IACMSkin/Window.IACMSkin.css"));
BundleTable.EnableOptimizations = true;
MasterPage:
<head runat="server">
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>My Sample</title>
<%: @Styles.Render("~/bundle/LoginPageCSS") %>
<%: @Scripts.Render("~/bundle/LoginPageJS") %>
</head>
It's working in my local machine as well as VM(Windows server 2016 IIS10) and not in UAT environment.
The difference I see here is Below is from my local and VM:
<link href="/bundle/LoginPageCSS?v=1FyFAVt-XUmly2H-AbvXacpx3b4ou5J-Tsk2Ac5PxaE1" rel="stylesheet"/>
<script src="/bundle/LoginPageJS?v=Kw5fkDuqDSQdMcwvucaZg-o1ChJ6qAulChBWIhFdZhc1"></script>
Below is from UAT:404 error
<link href="/bundle/LoginPageCSS" rel="stylesheet"/>
<script src="/bundle/LoginPageJS"></script>
I checked debug="false" as well.
Please help