0

I have MVC 4 web app developed on the VS2012 RC that works perfectly on the local machine. But unfortunately looses all styling and JS links on the Windows Server 2012 running IIS8. I am using bundling in App_Start/BundleConfig.cs following way:

bundles.Add(new StyleBundle("~/Content/themes/brain/css").Include(
                       "~/Content/themes/brain/css/colorpicker.css",
                       "~/Content/themes/brain/css/dataTable.css",
                       "~/Content/themes/brain/css/elfinder.css",
                       "~/Content/themes/brain/css/fullcalendar.css",
                       "~/Content/themes/brain/css/icons.css",
                       "~/Content/themes/brain/css/main.css",
                       "~/Content/themes/brain/css/prettyPhoto.css",
                       "~/Content/themes/brain/css/reset.css",
                       "~/Content/themes/brain/css/ui_custom.css",
                       "~/Content/themes/brain/css/wysiwyg.css"));

the development machine Chrome browser renders it following way and everything works:

<link href="/Content/themes/brain/css/reset.css" rel="stylesheet" type="text/css">
<link href="/Content/themes/brain/css/colorpicker.css" rel="stylesheet" type="text/css">
<link href="/Content/themes/brain/css/dataTable.css" rel="stylesheet" type="text/css">
<link href="/Content/themes/brain/css/elfinder.css" rel="stylesheet" type="text/css">
<link href="/Content/themes/brain/css/fullcalendar.css" rel="stylesheet" type="text/css">
<link href="/Content/themes/brain/css/icons.css" rel="stylesheet" type="text/css">
<link href="/Content/themes/brain/css/main.css" rel="stylesheet" type="text/css">
<link href="/Content/themes/brain/css/prettyPhoto.css" rel="stylesheet" type="text/css">
<link href="/Content/themes/brain/css/ui_custom.css" rel="stylesheet" type="text/css">
<link href="/Content/themes/brain/css/wysiwyg.css" rel="stylesheet" type="text/css">

but when I deploy that MVC 4 web app on Windows Server 2012 it looses all the styling and the rendered URL changes to following:

<link href="/Content/themes/brain/css?v=GrnUd5kGfttlbxsKkSshjvQMYvod-OnNzUX71bmBRPk1" rel="stylesheet" type="text/css">

Please advise if anyone knows the solution

1 Answers1

-1

Does the page render correctly on the server? That seems to be working as intended. On your development machine you probably have in your web.config. When this flag is set to false (or is missing) i.e. after deploying to your server, it turns optimization on and the bundling/minification happens.

Dustin
  • 107
  • 3
  • 9