I have a kind of standard MVC web application built with VS Express 2013.
My BundleConfig.cs is like this:
using System.Web;
using System.Web.Optimization;
namespace AcompOrcEst.UI
{
public class BundleConfig
{
// For more information on bundling, visit http://go.microsoft.com/fwlink/?LinkId=301862
public static void RegisterBundles(BundleCollection bundles)
{
bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
"~/Scripts/jquery-{version}.js"));
bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(
"~/Scripts/jquery.validate*"));
// Use the development version of Modernizr to develop with and learn from. Then, when you're
// ready for production, use the build tool at http://modernizr.com to pick only the tests you need.
bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(
"~/Scripts/modernizr-*"));
bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include(
"~/Scripts/bootstrap.js",
"~/Scripts/respond.js"));
bundles.Add(new StyleBundle("~/Content/css").Include(
"~/Content/bootstrap.flatly.min.css",
"~/Content/Site.css"));
}
}
}
I'm using this bootstrap.css alternative theme, bootstrap.flatly.min.css.
The section of my _Layout.cshtml is like this:
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="IE=edge;chrome=1" />
<title>@ViewBag.Title | Gestão do Orçamento Estrutural</title>
<link rel="shortcut icon" href="~/Content/Imagens/favicon.ico" type="image/x-icon" />
<link rel="icon" href="~/Content/Imagens/favicon.ico" type="image/x-icon" />
@Styles.Render("~/Content/css")
@Scripts.Render("~/bundles/modernizr")
</head>
When running the app in my development machine, i.e. localhost server, everything works pretty fine.
So, I published the app to the server (running IIS 7.5). I checked that all the files were copied to the server properly.
But when the app runs in the server the instruction bellow returns the HTTP Error 500!
@Styles.Render("~/Content/css")
From IE Developer Tools - Network I got the following infos:
I've tried changing the bootstrap.flatly.min.csss to the original bootstrap.css. No success!
I have similar apps, running in the very same server, that were built with the very same structure and use the very same style files. The BundleConfig.cs file have the same content, the section in _Layout.cshtml are the same, except for the ViewBag.Title. And all of them run properly.
I noticed that in the similar apps, the value of Content-Length of that similar request (the bundled css) is much higher: 113004.
So, I think that something, that I don't know what is, is corrupting the loading of the bundled css.
Could anyone help me to figure out what is happening?
Thanks in advance.
Paulo Ricardo Ferreira