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

4
  • Why would you be using anything CSS related when using a WebAPI project. Do you mean a standard web site template? Commented Jan 31, 2013 at 22:16
  • @Nick I assume it's both an MVC site and web api, which is possible. Is that right Peter? Commented Feb 1, 2013 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 Commented Feb 1, 2013 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. Commented Feb 2, 2013 at 16:57

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

1 Comment

Nice try, but not my problem. Content/Styles does not exist in my project.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.