0

I've got an app I started with ASP.NET MVC4 WebAPI project. somehow, my css is not getting rendered when I have BundleTable.EnableOptimizations Defaulted (which is true). When I set it to false (in my RegisterBundles.cs) file, the web site renders correctly.

What I'm seeing in my network traffic (which is failing with an http status 403, forbidden.

http://localhost:17138/Content/Styles/?v=xz2jRv8a4HMY4rDzixZn1RlC6AERf9qY0Gh7MavTpZE1

I keep comparing this to a default empty new project which works and I can't figure out what I'm missing.

THanks

Peter Kellner
  • 14,748
  • 25
  • 102
  • 188
  • Why would you be using anything CSS related when using a WebAPI project. Do you mean a standard web site template? – The Muffin Man Jan 31 '13 at 22:16
  • @Nick I assume it's both an MVC site and web api, which is possible. Is that right Peter? – Brian Mains Feb 01 '13 at 19:02
  • yes, same project. it uses the webapi template but it creates the full controller suite. In App_Start is BundleConfig,FilterConfig,RouteConfig AND WebApiConfig – Peter Kellner Feb 01 '13 at 22:53
  • True Brian. It feels like the bundler is buggy but maybe I'm missing something. It's not critical right now and summit is 2 weeks away so I'm sure I can get help there if I don't figure it by then. – Peter Kellner Feb 02 '13 at 16:57

1 Answers1

2

See this link, which suggests that the issue is with the /Content/Styles folder existing in your project: ASP.NET MVC framework 4.5 CSS bundles does not work on the hosting

As the answer there suggested, since the folder exists on disk, IIS handles the request.

Community
  • 1
  • 1
Brian Mains
  • 50,520
  • 35
  • 148
  • 257