1

I know there is a similar question here but the cause of the problem is different.

In my global.asax I am bundling two files:

Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
    Dim cssBundle As New StyleBundle("~/bundles/bundle1")
    cssBundle.Include("~/css/normalize.css", "~/css/main.css")
    BundleTable.EnableOptimizations = True
    BundleTable.Bundles.Add(cssBundle)
End Sub

In my Master page I then output:

<head runat="server">
    <%= System.Web.Optimization.Styles.Render("~/bundles/bundle1") %>
</head>

When running locally the browser renders this and everything works perfectly:

<link href="/bundles/bundle1?v=fU8Z_qH3ecSnJ9aM3BZrgcpbwQzeNBiu8CxQz5Pwbkw1" rel="stylesheet"/>

When published to Azure however, only this is rendered and Firebug shows a 404 being returned:

<link href="/bundles/bundle1" rel="stylesheet"/>

Scott Mitchell has posted a solution to a similar problem, however his fix was a typo. There are no typo's here (that I can see). The \bundles\ does not physically exist so cannot conflict (which I believe is the correct approach).

Community
  • 1
  • 1
EvilDr
  • 8,943
  • 14
  • 73
  • 133
  • Yes it's the correct approach. If there was a directory or file called `/bundles/bundle1` then it would break... what version of Optimization are you using? – MikeSmithDev Feb 10 '14 at 15:05
  • Hi @MikeSmithDev. It's version `1.1.31028.0` acccording to the DLL properties. – EvilDr Feb 12 '14 at 09:56

0 Answers0