0

I have the following in my BundleConfig.cs file

bundles.Add(new StyleBundle("~/Content/css").Include(
"~/Content/reset.css",
"~/Content/site.css"));

In my _Layout.cshtml file i set the styles like this

@Styles.Render("~/Content/css")

And when i set debug to false in web.config file i get this in the html source

<link rel="stylesheet" href="/Content/css?v=o98MVeaPnTOPDtb6WAqw14YyALxEnOYDmGqwfyBAiq01">
The resource from this url is not text: http://localhost:1135/Content/css?v=o98MVeaPnTOPDtb6WAqw14YyALxEnOYDmGqwfyBAiq01
</link>

And none of the styles get applied. What am i missing here?

Martin Overgaard
  • 355
  • 2
  • 7
  • 21
  • not sure if iis express or vs server puts out mime headers correctly. reference the css files directly and see if the headers are still correct. – Robert Hoffmann Jul 22 '13 at 22:23
  • Hi Robert, it seems like that I have a folder by the name Css in the Content folder. As I changed the name Css-->Styles everything works just fine ;o) – Martin Overgaard Jul 23 '13 at 08:51
  • strange, i use /content/css & /content/js here, and things work fine (but don't use bundling). Maybe a bug related to bundling that needs to be reported – Robert Hoffmann Jul 23 '13 at 10:37

1 Answers1

0

I had the same problem and discovered that it is a permissions issue. In order to create the bundles files at runtime Make sure that IUSR has read & execute permissions on the directory. I do not use Cassini for debugging my VS project, instead I create applications in IIS. I do this by adding them to my hosts file like this 127.0.0.1 mysitename.local, then create an IIS application with the domain name mysitename.local (I use .local domain extension to make sure that is not likely to clash with a real TLD) and set this up in VS project properties. What happens when doing this is that IIS inherits the permissions from the parent object (in my case C:\workspace) and therefore IUSR was not included by default.